一充蓝、 安裝git
Windows 10下安裝Git
https://git-scm.com/download/winLinux下安裝Git:
https://git-scm.com/download/linuxMac 安裝Git:
https://git-scm.com/download/mac
二本讥、ssh key、配置git
1泉粉、設(shè)置username和email
git config --global user.name “此處填寫(xiě)你的郵箱前綴”
git config --global user.email "此處填寫(xiě)工作郵箱"
2、通過(guò)終端命令創(chuàng)建ssh key
ssh-keygen -t rsa -C “此處填寫(xiě)工作郵箱”
3、config配置
- .ssh/config 常用配置 https://www.cnblogs.com/hangj/p/11506686.html
- (>和>>)的區(qū)別 https://jingyan.baidu.com/article/948f59240ef17dd80ff5f9ba.html
echo "Host gerrit_me" >> ~/.ssh/config
echo "HostName gerrit ip地址/域名" >> ~/.ssh/config
echo "Port 29418" >> ~/.ssh/config
echo "User gerrit登錄的用戶(hù)名" >> ~/.ssh/config
echo "IdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config
配置public key
-
cat本機(jī)電腦上~/.ssh下的id_rsa.pub粘貼到Settings 內(nèi)的SSH Public Keys