Ubuntu comes with Git is 1.7 version, too old, so want to upgrade, GIT official online does not provide ready-made installation package, so only energy code compiled.
Linux on the source code compiled to install Git fly in two steps:
The first step is to install a git-compiled dependency package
Step Two, download the source code, compile and install git
Install the GIT installation package:
On the Apt-get system:
sudo apt-get install Curl curl-devel zlib-devel openssl-devel perl cpio expat-devel Gettex-devel
On the Yum system:
Yum Install Curl
Yum Install Curl-devel
Yum Install Zlib-devel
Yum Install Openssl-devel
Yum Install Perl
Yum Install Cpio
Yum Install Expat-devel
Yum Install Gettext-devel
Download the source code, compile and install git:
Because Ubuntu comes with git, you can download git source from git clone:
git clone https://github.com/git/git.git
without git, you can go to GitHub to download: Https://github.com/git/git
on GitHub:Https://github.com/git/git/archive/master.zip
can also be in Command input: wget https://github.com/git/git/archive/master.zip
PS: Not really, can be downloaded to me http://download.csdn.net/detail/caiwenfeng_for_23/8600135 This is the git2.4.0 version of the
Unzip Git2.4.0.rc2_master.zip
CD GIT-XXXX-XX-XX
Autoconf (under Ubuntu to install sudo apt-get installation autoconf)
./configure
Make
Make install (may report permissions issues, I am switching to root under the compiler installation, easy)
Finally, enter Git--version to view the version.
Upgrade git version under Ubuntu (source code compiled to install git)