安裝及配置
參考地址:http://blog.csdn.net/qq_26990831/article/details/51857399
1.git 安裝
sudo apt-get install git
2.配置本機git的兩個重要信息,user.name和user.email
git config --global user.name "Your Name"
git config --global user.email "email@example.com"
然后我們可通過命令 git config --list,查看是否設置成功
3. 查看home目錄下是否有.ssh目錄或者home目錄下的ubuntu目錄下是否有 .ssh目錄,如果沒有的話需要下面命令來生成git的ssh key
ssh-keygen -t rsa -C "youremail@example.com"
然后一直回車就可以了
4.在github上面要添加 .ssh的公鑰
cd /home/ubuntu/.ssh //如果沒有找到.ssh 可以嘗試在 /root/.ssh/下面找到 id_rsa.pub
cat id_rsa.pub
然后將這個文件中的內容添加到github上的添加公鑰的地方即可
git更新版本
參考地址:http://www.cnblogs.com/shaobin0604/p/5987633.html
執行下面命令即可更新git
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git