Install git tutorials on various Linux distributions

Source: Internet
Author: User
Tags gettext centos version control system arch linux linux mint

Git is a popular open source version control system (VCS) that was originally developed for the Linux environment. Unlike CVS or SVN version control systems, Git's versioning is considered "distributed", and in a sense, Git's local working directory can be used as a fully functional warehouse with complete history and version tracking capabilities. Under this working model, each collaborator submits content to their local repository (which is always submitted to the core repository) and, if necessary, is selectively pushed to the core repository. This brings the scalability and redundancy required by a large collaboration system to git, the version management system.

Install git using the Package Manager

Git has been supported by all the mainstream Linux distributions. So the easiest way to install it is to use the Package Manager for each Linux distribution.

Debian, Ubuntu, or Linux Mint

The code is as follows:

$ sudo apt-get install git

Fedora, CentOS or RHEL

The code is as follows:

$ sudo yum install git

Or

The code is as follows:

$ sudo DNF install git

Arch Linux

The code is as follows:

$ sudo pacman-s git

OpenSUSE

The code is as follows:

$ sudo zypper install git

Gentoo

The code is as follows:

$ emerge--ask--verbose Dev-vcs/git

Install Git from source

If for some reason you want to install Git from the source code, follow the instructions below.

Install Dependency Pack

Before you build git, install its dependent packages first.

Debian, Ubuntu or Linux Mint

The code is as follows:

$ sudo apt-get install Libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto docbook2x

Fedora, CentOS or RHEL

The code is as follows:

$ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc xmlto docbook2x

Compiling git from source

Download the latest version of Git from https://github.com/git/git/releases. Then build and install in/usr.

Note that if you plan to install to a different directory (for example:/OPT), replace the "--prefix=/usr" configuration command with a different path.

The code is as follows:

$ CD git-x.x.x

$ make Configure

$./configure--PREFIX=/USR

$ make All DOC info

$ sudo make install Install-doc install-html install-info

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.