useradd git su - git
git clone https://github.com/sitaramc/gitolite mkdir -p $HOME/bin gitolite/install -to $HOME/bin //下载zip包时,还需要git bundle create /tmp/repositoryname.bundle --all
ssh-keygen //生成.ssh/id_rsa、.ssh/id_rsa.pub,然后用自己的密钥替换内容(git关联id_rsa名字,或配置.ssh/config) gitolite setup -pk .ssh/id_rsa.pub //创建了/home/git/repositories/gitolite-admin.git,/test.git
git clone git@xlongwei.com:gitolite-admin
//收集用户的公钥到keydir目录,命名规则{name}.pub vi conf/gitolite.conf @admin = user1 user2 //定义用户组,R读 W写 +强制更新 C创建 repo dir/..*目录内权限 repo foo RW+ = alice - master = bob - refs/tags/v[0-9] = bob RW = bob RW refs/tags/v[0-9] = carol R = dave //RW+ 全部权限,bob可以读写(非master分支),carol可以创建v1之类的tag,dave可以读取 //git add . //git commit -m "add repo foo" //git push
* 解决:no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
vi ~/.ssh/config //或vi /etc/ssh/ssh_config Host * KexAlgorithms +diffie-hellman-group1-sha1