git install and use (Linux) "Go"

Source: Internet
Author: User
Tags bz2 svn version control system git commands

Transferred from: http://my.oschina.net/fhd/blog/354685

Git was born on the Linux platform and served as a version control system for the Linux kernel, so it's very convenient to install Git on Linux. There are two different ways to install Git on Linux: one is to install a compiled binary-formatted GIT package through the Linux distribution Package Manager, and the other way is to start the installation from Git source.

Package Manager Mode Installation

It's easiest to install git with the Linux distribution Package Manager, and it's automatically configured with command completion, but the GIT installation may not be the latest version. It is also important to note that GIT packages may not be called Git in some Linux distributions, but rather called Git-core. This is because there is a GNU software called the GNU Interactive Tool (GNU Interactive tools), which takes the name of git before git in some Linux distributions (Deian Lenny). To differentiate, Git is so famous as a version control system, so some Linux distributions change the name of the GNU Interactive Tools package from Git to Gnuit in the latest version, changing Git-core to Git. So when you install Git in a different Linux distribution, as described below, you'll see that git and Git-core have two different names.

--ubuntu 10.10 (Maverick) or newer version, Debian (squeeze) or newer version:

?
12 sudoaptitude install gitsudo aptitude installgit-doc git-svn git-email git-gui gitk

The GIT package contains most of the Git commands and is a must-install package. The package GIT-SVN,GIT-EMAIL,GIT-GUI,GITK was originally part of the GIT package, but was released separately as a package because it was trusted by different software packages. The package Git-doc contains Git's HTML-formatted document, which you can choose to install. If you have a git HTML-formatted document installed, you can use the git help-w <sub-command> command to get HTML Help from a Web browser to open related subcommands <sub-command>.

--ubuntu10.04 (lucid) or older version, Debian (Lenny) or older version:

In the older version of Debian, package git actually refers to GNU Interactive Tools, not git as a version control system. Git as a version control system is in the package Git-core.

?
12 sudoaptitude install git-coresudo aptitude installgit-doc git-svn git-email git-gui gitk

--rhel,fedora,centos:

?
12 $ yum installgit$ yum installgit-doc git-svn git-email git-gui gitk

The process of installing git in other distributions is similar to the method described above. The GIT package is in these distributions or is git, or called Git-core.

Installing from a source code

Visit Git's official website: http://git-scm.com/. Download git source package, for example: git-1.7.4.1.tar.bz2. The installation process is as follows:

1. Expand the source package and go to the appropriate directory.

?
12 tar-xjvf git-1.7.4.1.tar.bz2cdgit-1.7.4.1/

2. The installation method is written in the install file, which can be completed by referring to the instructions. The following command installs Git in/usr/local/bin.

?
12 makeprefix=/usr/local allsudo make prefix=/usr/localinstall

3. Install the GIT document (optional)

Compiled documents are primarily HTML-formatted documents that are easy to view via git help-w <sub-command> commands. In fact, even if you don't install git docs, you can use the man manual to view git help, and use the command git helper <sub-command> or git <sub-command>--help.

Compiling the document relies on AsciiDoc, so you need to install AsciiDoc (if it is not already installed) and then compile the document. It takes a lot of time to compile the document and be patient.

?
12 makeprefix=/usr/local doc infosudo make prefix=/usr/localinstall-doc install-html install-info

After the installation is complete, git can be found under/usr/local/bin.

git install and use (Linux) "Go"

Related Article

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.