【Repo&Git】下载新代码该做的配置

下载一份新代码需要做的步骤:

1、拷贝 .gitconf 到根目录下并修改name和mail,也可以自己建.gitconfig文件。

  放置在根目录下。

[user]

  name = 张三
  email = 公司邮箱
[core]
  editor = vim
  rditor = vi
[color]
  ui = auto

[url "[http://用户名@gerrit地址/ "]
pushInsteadOf = gitolite@gerrit地址/

[credential]
  helper = store

2、在 gerrit上贴 SSH key

   生成方法:

   ssh-keygen -t rsa -C 邮箱      【注意:一定要确保邮箱正确,和下载服务器的归属一致】

   ssh-add                                           【必须执行,负责会报错“Agent admitted failure to sign using the key”】 

3、在A公司服务器上从B公司下载代码:

     账户:user
     密码:password
     repo init -u ssh://username@gerrit地址/path

原文地址:https://www.cnblogs.com/zhuwei0901-yanwu/p/9548081.html