1. Windows端Git配置
安裝git bash
配置ssh和密鑰
// cd ~ 進(jìn)入用戶Home目錄下
$ ssh-keygen 回車,一直回車,直到生成圖形(randomart image)
$ cd ~/.ssh
$ vi config 編輯生成一個config文件 內(nèi)容如下:
user leilll
port 29888 // 端口
host 192.168.10.88 // ip地址
identityfile ~/.ssh/id_rsa wq 保存退出
- 將id_rsa.pub里的內(nèi)容拷貝到gerrit上,具體如下
打開192.168.10.88 gerrit網(wǎng)頁,
點(diǎn)擊setting --> ssh public key --> add 添加進(jìn)去
最后用ssh 192.168.10.88連接是否成功。
將公鑰(id_rsa.pub中的內(nèi)容)添加到 gerrit代碼服務(wù)器上
拉取代碼
$ git clone ssh
2. Create a new repository on the command line
$ echo "# Anti-sCustom" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin <https://github.com/xxx/xxxxx.git>
$ git push -u origin master
3. Push an existing repository from the command line
$ git remote add origin <https://github.com/xxx/xxxx.git>
$ git push -u origin master