1.下載
鏈接:https://pan.baidu.com/s/1rK8c7WIAyuoHDo2eVruGMQ
提取碼:ax8a
2.解壓
tar -zxvf --------.tar.gz
3.編譯
make prefix=/usr/local/git all
make prefix=/usr/local/git install
4.配置環境變量
vim /etc/profile
生效配置文件 source /etc/profile
5.配置git信息
(1) . 設置git的 user name和 email
git config --global user.name "xxx"
git config --global user.email "[email protected]"
(2) . 生成SSH密鑰過程
1.查看是否已經有了ssh密鑰:cd ~/.ssh
如果沒有密鑰則不會有此文件夾,有則備份刪除
2.生存密鑰
ssh-keygen -t rsa -C 「[email protected]」
而後我們將id_rsa.pub裏的內容複製粘貼到gitthub賬號設置裏的ssh-key,title隨便填,ssh-key裏爲id_rsa.