1. 賬號激活
2. 直接搜git for windows下載安裝客戶端
3. ssh key生成
執行$ ssh-keygen -C [email protected],完成後,會生成公鑰文件id_rsa.pub和私鑰文件id_rsa。
4. 配置public-key
首先配置本機hosts文件域名映射:10.147.20.1 gerrit.cmss.com
一般路徑在C:\Windows\System32\drivers\etc\hosts
打開瀏覽器,訪問http://gerrit.cmss.com,彈出對話框,輸入用戶名及密碼。
右上角點擊 用戶名- settting – Contact information填寫full name以及註冊接收信息的郵箱,輸入自己的郵箱。
點擊setting -SSH Public Keys設置訪問倉庫的祕鑰。
並將上面創建的個人公鑰內容複製到輸入框中,點擊add完成操作。
5. 測試連接
執行$ ssh -p 29418 用戶名@gerrit.cmss.com,顯示如下圖。
6. 創建commit-msg模板
$ vi ~/.gitcommit
[Required]50-character subject line Code Source From: [Required] # Self Code / OpenSource / 3rd party Code / Other Description: [Optional] Jira: #[Optional] 市場項目編號(名稱):[Optional] |
使之全局生效:
$ git config --global commit.template ~/.gitcommit
查詢 commit-template配置信息:
$ git config --global --list