1. 源码编译升级git版本
卸载源安装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
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
卸载源安装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
本文介绍了两种在Ubuntu系统中升级Git版本的方法。一种是通过源码编译的方式进行升级,另一种则是利用apt-get命令结合ppa仓库来实现。这两种方法都能有效解决因Git版本过低而导致的问题。
1153

被折叠的 条评论
为什么被折叠?



