1、在linux工作机上生成密钥对
ssh-keygen -t rsa
输入用户名但不输入passphrase,这样连接时就不用每次都输入passphrase了。
2、添加用户和仓库
在管理员的工作机上导出
gitolite-admin
git clone git@host:gitolite-admin
在keydir中加入第1步生成的xxx.pub
在conf中的gitolite.conf中加入:
repo repo_name(仓库名)
RW+ = xxx(用户名)
3、将第2步的操作push到远程服务器上。
4、在linux工作机上下载刚创建的仓库
git clone git@ip:repo-name
以后就可以操作自己的仓库了。
注意:xxx.pub文件名xxx即是你登录到gitolite上的用户名。
If they need to know what repos they have access to, they just have to run "ssh git@host info".
groups
Gitolite allows you to group users or repos for convenience. Here's an example that creates two groups of users:
@staff = alice bob carol
@interns = ashok
repo secret
RW = @staff
repo foss
RW+ = @staff
RW = @interns
roup lists accumulate. The following two lines have the same effect as the earlier definition of @staff above:
@staff = alice bob
@staff = carol
You can also use group names in other group names:
@all-devs = @staff @interns
Finally, @all is a special group name that is often convenient to use if you really mean "all repos" or "all users".
commands
Users can run certain commands remotely, using ssh. Running
ssh git@host help
prints a list of available commands.