centOS下暗转git及gitolite
客户端:
$ ssh-keygen -t rsa -f ~/.ssh/admin $ scp ~/.ssh/admin.pub server:/tmp/admin.pub
#将公钥保存到服务器留待后用,server为服务器的IP地址
将adminpub文件上传到/tmp目录下
服务器:
安装git,并查看版本确定装成功.
$ rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm $ yum -y install python-setuptools $ yum -y install git $ git –version
建立用户和目录,并设置相应权限
$ mkdir -p /data/git $ groupadd git $ useradd -g git -d /data/git/ -s /bin/bash git $ passwd git $ chown -R git:git /data/git $ chmod -R 2755 /data/git/
在刚才建立的用户主目录下克隆gitolite(蒋鑫版)
$ su git $ cd $HOME $ git clone git://github.com/ossxp-com/gitolite.git $ exit
创建目录,执行安装.
$ cd /data/git/ $ mkdir -p /usr/local/share/gitolite/conf /usr/local/share/gitolite/hooks $ cd gitolite/src/ $ ./gl-system-install /usr/local/bin /usr/local/share/gitolite/conf /usr/local/share/gitolite/hooks
在专用帐号执行安装脚本.
$ su – git $ gl-setup /tmp/admin.pub
客户端:
$ git clone git@server:gitolite-admin
相关推荐
LynnOhYeah 2020-02-18
ffcsdn 2011-09-09
vagabond 2011-06-11
kenthomsen 2017-03-28
webhwg 2015-08-01
萌新JedLee 2012-09-04
lljhi0 2013-02-07
nebulali 2012-08-01
smileZZZZZ 2019-06-20
pursuemylife 2017-07-18
chaocc0xs 2017-07-18
pursuemylife 2017-07-18
冯三思 2015-10-17
CSDNA 2015-02-14
FullStackTester 2014-06-11
ffcsdn 2014-02-21
冯三思 2012-05-22