【Repo&Git】下載新代碼該作的配置

 

下載一份新代碼須要作的步驟: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

相關文章
相關標籤/搜索