Android開發之Git配置

來源:互聯網
上載者:User

標籤:

                                                    Android開發之Git配置

      

1.首先git配置:

輸入命令:

         git config --global user.name "xxx.xx"

         git config --global user.email "[email protected]"

         git config --global commit.template "/home/xxx/commit.template"

名字改成自己的。

可以通過git config --global --list查看命令是否配置:

user.name=xxx.xx

[email protected]

commit.template=/home/xxx/commit.template

 

2.配置ssh:

輸入命令:

         ssh-keygen

然後一路斷行符號,結束後,到根目錄下的.ssh檔案夾中,

輸入命令:

         touch config

建立config檔案,添加下面內容:

Host 192.168.10.x

User xxx.xx

Port 29418

IdentityFile ~/.ssh/id_rsa

 

Host 192.168.10.xx

User xxx.xx

Port 29418

Hostname 192.168.10.xx

IdentityFile ~/.ssh/id_rsa

 

Host 192.168.10.xxx

User xxx.xx

Port 29418

Hostname 192.168.10.xxx

IdentityFile ~/.ssh/id_rsa

不要忘記修改User。

將id_rsa.pub中的全部內容拷貝到gerrit上,上述三個伺服器都要添加SSH Public Keys。在瀏覽器上輸入Host後面的地址登入伺服器,如果伺服器上沒有帳號註冊一個。

SSH Public Keys位置在setting中:

 

 

點擊add key,將複製的內容拷貝進來,如下:

 

點擊add就ok了。

回到伺服器,repo代碼的時候會出現提示,輸入yes斷行符號即可。

Android開發之Git配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.