if [ "`uname -m`" == "x86_64" ]; then
rpm -Uhv
rpm -Uvh
elif [ "`uname -m`" == "i686" ]; then
rpm -Uhv
rpm -Uvh
fi
#server:
yum install git -y
mkdir -p /data/git
groupadd git
useradd -g git -d /data/git -s /bin/bash git
echo '123456'|passwd git --stdin
chown -R git:git /data/git
chmod -R 2755 /data/git
su - git
git clone git://github.com/sitaramc/gitolite
cd gitolite
mkdir -p $HOME/bin $HOME/share/gitolite/conf $HOME/share/gitolite/hooks
src/gl-system-install $HOME/bin $HOME/share/gitolite/conf $HOME/share/gitolite/hooks
echo "PATH=$PATH:$HOME/bin" >> ~/.bashrc
source ~/.bashrc
gl-setup /tmp/admin.pub
client:
ssh-keygen -t rsa -f ~/.ssh/admin
scp ~/.ssh/admin.pub 192.168.2.11:/tmp/admin.pub
vim .ssh/config
host gitolite
user git
hostname 192.168.2.11
port 22
identityfile ~/.ssh/admin
[root@mfs2 ~]# git clone gitolite:gitolite-admin.git
Cloning into gitolite-admin...
Address 192.168.2.11 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 6 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (6/6), 730 bytes, done.
git status
git config --global user.email "h3ewhack@163.com"
git config --global user.name "admin"
git commit -m "add global"
git push
添加git repository
vim conf/gitolite.conf
....
repo akin
RW+ = @all
git commit -a -m "add new repo akin"
git push
git clone gitolite:akin.git
cd akin
touch readme
git add .
git commit -m 'add readme'
git push origin master
总本上说没有SVN简单,不过也挺好玩的!
阅读(1570) | 评论(1) | 转发(0) |