Mac系統自帶git但是跟xcode綁定的,平時不用xcode開發ios端app,可以采用不安裝xcode的方法安裝git,步驟如下:
1、
xcode-select --install
單獨安裝CommandLineTools
2、
sudo xcode-select --switch /Library/Developer/CommandLineTools
然後輸入
git version
git version 2.11.0 (Apple Git-81)
git就安裝成功了
配置github和gitee的ssh
git config --global user.name "lianchor"
git config --global user.email "郵箱賬号"
ls -a
ssh-keygen -t rsa -C 郵箱賬号
連續按Enter鍵

cat /Users/lianchor/.ssh/id_rsa.pub
ssh -T [email protected].com
ssh -T [email protected].com
配置成功!