Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4873673
  • 博文数量: 1604
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 14895
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
  • 认证徽章:
文章分类

全部博文(1604)

文章存档

2019年(25)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(144)

2011年(236)

2010年(267)

2009年(391)

2008年(250)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2011-09-26 16:20:10

if [ "`uname -m`" == "x86_64" ]; then
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
elif [ "`uname -m`" == "i686" ]; then
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
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简单,不过也挺好玩的!
阅读(978) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~
评论热议
请登录后评论。

登录 注册