Detailed installation of git
Git
Hands down it's time to try to Git, but it was first installed. There are many types of installation, divided into two types, one is mounted by compiling the source code; the other is used for a specific pre-compiled package internet.
Installation from source
If conditions permit, to install from source code has many advantages, at least you can install the latest version. Each version of Git are constantly trying to improve the user experience, so by their own source code to compile and install the latest version, all the better. Some Linux version comes with updated installation package is not up in time, so unless you are using the latest distro or backports, then install from the source code in fact, if this is the best choice.
Git work requires the calling code curl, zlib, openssl, expat, libiconv library, etc., so you need to install these tools rely on. Yum on the system (such as Fedora) or apt-get have system (such as Debian system) can be installed with the following command:
$ yum install curl-devel expat-devel gettext-devel \ openssl-devel zlib-devel$ apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \ libz-dev libssl-dev
After that, download the latest version of the source code from the following Git official site:
http://git-scm.com/download
Then compile and install:
$ tar -zxf git-1.7.2.2.tar.gz$ cd git-1.7.2.2$ make prefix=/usr/local all$ sudo make prefix=/usr/local install
Now you can use git
the command, and with git
the Git project to clone a local repository, to be updated in the future:
$ git clone git://git.kernel.org/pub/scm/git/git.git
Installation on Linux
If you want to install pre-compiled binary packages Git on Linux, you can use the system to provide direct package management tool. Using yum mounted on Fedora:
$ yum install git-core
On such systems Ubuntu Debian system, can be installed apt-get:
$ apt-get install git
Installation on a Mac
Install Git on a Mac in two ways. Undoubtedly the most easy to use graphical Git installation tool, the interface shown in Figure 1-7, the Download:
http://sourceforge.net/projects/git-osx-installer/
FIG 1-7. Git OS X installation tool
Another is by MacPorts ( http://www.macports.org
) is mounted. If you have already installed the MacPorts, install Git with the following command:
$ sudo port install git-core +svn +doc +bash_completion +gitweb
This way you do not need to rely on their own to install the library, Macports will seal the deal these troubles. Installation options listed above generally has been good enough, if you want to use Git Subversion code repository connection, you can also add + svn option will be introduced in particular Chapter VIII. (Translation: there is a use homebrew https://github.com/mxcl/homebrew
( brew install git
): .)
Installing on Windows
Installed on Windows Git just as easily, a man named msysGit project provides installation package can go to the GitHub page to download the installation file and run the exe:
http://msysgit.github.com/
Once installed, you can use the command line git
tool (already comes with the ssh client), and a graphical interface in addition to Git project management tool.
Letter to Windows users: Unix-style shell you should msysGit offer to run Git. In Unix-style shell, you can use the command complex book mentioned in multiple rows. For users who need to use Git in Windows command line, must be noted: when the intermediate parameter spaces must be double quotes parameter quotes (single quotes in Linux); In addition, if the circumflex (^) as the end of the parameter, and as the last character of the line, then this parameter may also need to use double quotes. Because the circumflex indicate line continuation in the Windows command line (translation: the behavior of this line continues to the next command).