卸載源安裝git版本
$ apt-get remove git git-core
$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev libssl-dev asciidoc docbook2x
$ git clone git://git.kernel.org/pub/scm/git/git.git
$ cd git
$ git checkout v1.8.2.2
$ echo v1.8.2.2 > version
$ make prefix=/usr all doc info
$ sudo make prefix=/usr install
$ which git
/usr/bin/git
$ git --version
git version 1.8.2.2
2. ubuntu下apt-get 升級git
使用git提交github工程的時候,
報錯:
Error: The requested URL returned error: 403 while accessing
# fatal: HTTP request failed
查看官方的指南:
https://help.github.com/articles/https-cloning-errors
結果發現git版本爲1.7.4,(git --version)而官方提示必須是1.7.10及以後版本
升級
增加ppa
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
如果本地已經安裝過Git,可以使用升級命令:
sudo apt-get dist-upgrade