Install git (I choose to install from the source code)

Source: Internet
Author: User

Installing on Linux

If you want to install Git with a binary installer on Linux, you can install it using the basic package management tools included with the release. If you take Fedora as an example, you can use Yum:

  $ sudo yum install git

If you're on a Debian-based distribution, try using Apt-get:

  $ sudo apt-get install git

To learn more, the GIT website has installation steps on a variety of Unix-style systems, with the URL http://git-scm.com/download/linux.

Install on MAC

There are several ways to install Git on your Mac. The simplest way is to install Xcode Command line Tools. Mavericks (10.9) or later, in Terminal, try running the git command for the first time. If you do not have a command line developer tool installed, you will be prompted to install it.

If you want to install an updated version, you can use the binary Setup program. The official OSX git installer can be downloaded from the GIT website at Http://git-scm.com/download/mac.

Figure 1-7. Git OS X Installer.

You can also install it as part of your GitHub for MAC. Their graphical Git tools have an option to install command-line tools. You can download the tool from the GitHub for Mac website at http://mac.github.com.

Installing on Windows

There are several installation methods for installing Git on Windows. The official version can be downloaded from the Git official website. Open Http://git-scm.com/download/winand the download will start automatically. Note that this is a project called Git for Windows (also called msysgit), and Git is a separate project; For more information, visit http://msysgit.github.io/.

Another easy way is to install GitHub for Windows. The installer contains graphical and command-line versions of Git. It can also support Powershell, providing a stable credential cache and robust CRLF settings. We will learn more about this in a moment, and now suffice it to say that it is all you need. You can download the GitHub for Windows website at http://windows.github.com.

Installing from source code

Some people find it more practical to install Git from the source because you can get the latest version. The binary installer tends to have some lag, and of course Git has matured in recent years, and the difference is no longer significant.

If you want to install Git from the source, you need to install git-dependent libraries: curl, zlib, OpenSSL, expat, and Libiconv. If you have Yum (such as Fedora) or apt-get (such as a Debian-based system) on your system, you can use one of the following commands to install the minimized dependency package to compile and install Git binaries:

  $ sudo yum install curl-devel expat-devel gettext-devel \    openssl-devel zlib-devel  $ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \    libz-dev libssl-dev

In order to be able to add more formats to a document (such as doc, HTML, info), you need to install the following dependency packages:

  $ sudo yum install asciidoc xmlto docbook2x  $ sudo apt-get install asciidoc xmlto docbook2x

When you install all the necessary dependencies, you can continue to get the latest released version of the TAR package from several places. You can get it from the kernel.org website, at Https://www.kernel.org/pub/software/scm/git, or from the image on the GitHub website, at the URL of https:// Github.com/git/git/releases. This is usually the latest version on GitHub, but the kernel.org contains a file download signature, which is used if you want to verify that the download is correct.

Next, compile and install:

  $ tar -zxf git-2.0.0.tar.gz  $ cd git-2.0.0  $ make configure  $ ./configure --prefix=/usr  $ make all doc info  $ sudo make install install-doc install-html install-info

When you're done, you can use Git to get a git upgrade:

  $ git clone git://git.kernel.org/pub/scm/git/git.git

Install git (I choose to install from the source code)

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.