标签:push clone repo 免密码 生效 提交 git testing add
Ubuntu搭建gitolite服务:$ ssh-keygen
回车(即不设置密码)
$ git clone git://github.com/sitaramc/gitolite
$ mkdir bin
$ ./gitolite/install -to ~/bin
$ ~/bin/gitolite setup -pk ~/.ssh/id_rsa.pub
$ git clone git@127.0.0.1:gitolite-admin.git
设置客户端用户免密码下载
将用户的id_rsa.pub放到服务器端/home/git/gitolite-admin/keydir/下并改为用户的名字(如ming.pub)
$ cd gitolite-admin
$ git add .
$ git commit -m "add ming key"
$ git push origin master
新加仓库:
$ cd gitolite-admin
$ vi conf/gitolite.conf
repo project
RW+ = ming (多帐号用空格隔开)
:wq
$ git add .
$ git commit -m "add project"
$ git push origin master
此时会自动在/home/git/repositories下生成project.git目录
客户端测试(ming帐号,下载帐号为git,testing.git默认为all的权限,测试用的):
下载:
$ git clone git@10.0.1.5:project
提交:
$ cd project
$ touch aa.txt
$ git add .
$ git commit -m "add aa.txt"
$ git push origin master
重新下载(验证提交是否生效):
$ rm -rf project
$ git clone git@10.0.1.5:project
标签:push clone repo 免密码 生效 提交 git testing add
原文地址:https://blog.51cto.com/yangzhiming/2550627