ubuntu10.04 LTS升级git 版本

来源:互联网 发布:千牛直播和淘宝直播 编辑:程序博客网 时间:2024/05/19 13:25

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

$ 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