Installation of Git under Ubuntu

Source: Internet
Author: User
Tags git clone

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.