下载一份新代码须要作的步骤:git
一、拷贝 .gitconf 到根目录下并修改name和mail,也能够本身建.gitconfig文件。vim
放置在根目录下。服务器
[user]ssh
name = 张三
email = 公司邮箱
[core]
editor = vim
rditor = vi
[color]
ui = autoui
[url "[http://用户名@gerrit地址/ "]
pushInsteadOf = gitolite@gerrit地址/url
[credential]
helper = storeblog
二、在 gerrit上贴 SSH keyit
生成方法:email
ssh-keygen -t rsa -C 邮箱 【注意:必定要确保邮箱正确,和下载服务器的归属一致】rsa
ssh-add 【必须执行,负责会报错“Agent admitted failure to sign using the key”】
三、在A公司服务器上从B公司下载代码:
帐户:user 密码:password repo init -u ssh://username@gerrit地址/path