您的位置:首页 > 其它

配置gitosis for mac osx and ubuntu

2013-12-05 21:14 190 查看

 Client side                                               |       server side

1.Create "git" accout

Mac
             Finder/System preferences/User and Groups/
Linux: 

     $ sudo useradd -s /bin/bash -mr git 

     $ sudo adduser git sudo

     $ sudo passwd git
    

2.Download and setup gitolite

Mac & Linux:

     $ git clone git://github.com/ossxp-com/gitolite.git

     $ cd gitolite/src

     $ ./gl-easy-install git server admin

3. Generate ssh key and copy .pub to git account

$ ssh-keygen -t rsa

$ scp ~/.ssh/id_rsa.pub git@ip:~

              4. Init gitosis using step3 ssh pub key

$ sudo -H -u git gitosis-init < /tmp/yourname.pub

$ cd ~/.ssh

$delete "command="gitosis-serve yourname",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty " in authorized_keys file

$ sudo chmod 755 /Users/git/repositories/gitosis-admin.git/hooks/post-update (mac)

5 set the git path to PATH env

$ touch ~/.bashrc

$ echo PATH=/usr/local/bin:/usr/local/git/bin:\$PATH > .bashrc

$ echo export PATH >> .bashrc

6. Manage gitosis 

      $ git clone git@192.168.1.100:repositories/gitosis-admin.git

      $ add user in keydir and project member's in gitosis.conf
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: