Linux software installed in a variety of ways, the simplest is to install directly from the Software center or directly with the command line installation
sudo apt-get install git
But this kind of installation lets us not realize the newest version the function, if we want to experience the newest, or modifies the source code, must compile installs. We can do it directly on Git's website.
Downloaded and installed.
Before compiling, we must first install the following software, otherwise the compilation will not pass.
sudo apt-get install Libcurl4-openssl-dev Libexpat1-dev
After installation we can compile, of course, before compiling we must enter the source of the directory, as to how to enter, we will solve it yourself, enter after the following command to compile:
Make prefix=/usr/local All
Final execution
sudo make prefix=/usr/local install
For installation.
The best way to do this is to clone a git repository locally, but if you already have Git installed, you're not going to be able to clone the repository:
First enter the directory you want to store, of course, you can not enter, git clone the default second parameter is your path, omitted is your current path:
git clone git://git.kernel.org/pub/scm/git/git.git
The default check out after cloning (checkout) The current latest code of course you can also install the previous version, execute the following command to check out all the history of the version
git tag
For example, I want to check out v1.7.8.2 now, this version, I just need to execute the following command on the line:
git checkout v1.7.8.2
After checking out, we can use the method described above to compile
Installation of Git under Ubuntu