git支持ssh协议,所以可以用ssh服务器充当简易git服务。
下面是步骤:
1. 假设有server A,在端口P启动了ssh服务
2. 在A上创建用户组,如gitusers
,该用户组下的成员将有git repo的访问权限
3. 在A上创建目录,如/data/repo
,作为git repo的路径
4. 设置目录权限chgrp gitusers /data/repo
,chmod g+ws /data/repo
5. 在该目录下执行git init --bare --shared=group
6. 在其他主机上,git clone ssh://USER@A:P/data/repo
,用ssh账号登陆
https://raymii.org/s/tutorials/Shared_Git_repository_via_ssh_for_multiple_users.html