Book creator (disable)

Source Control Management With Git/Obtaining Git

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Git is only officially available for UNIX and UNIX-based operating systems. This is largely because of its strong reliance on bash and perl scripts. You can acquire git in either binary or source form. Git is in the early stages of a native port to Microsoft Windows, and can be currently run through Cygwin, the POSIX emulater for Windows.

Contents

[edit] Binary

Be aware that git is under fast development, and most Linux distributions freeze at a time inconvenient for their upstream components. For instance the git in Ubuntu Gutsy (released Oct 1919) is v1.5.2.5 a far cry from v1.5.3, the version that first introduced superpackage, and submodule functionality.

[edit] Debian based distributions (.deb)

Git is available on both Ubuntu and Debian. It is currently packaged as git-core. Not to be confused with the like named git which is a totally unrelated file manager.

[edit] RPM based distributions (.rpm)


[edit] Windows

Git is available as msysgit from google code.

[edit] Source

[edit] Tarball

You can obtain a copy of the newest stable git from the git homepage at: git.or.cz. In addition, daily snapshots of git are provided by Dave Jones and are hosted at codemonkey.org.uk.

Below is an example of how to compile git from source, change "git-1.5.3.4.tar.gz" to the version you want:

mkdir ~/src
cd ~/src
wget http://kernel.org/pub/software/scm/git/git-1.5.3.4.tar.gz
tar xzvf git-1.5.3.4.tar.gz
cd git-1.5.3.4
make configure
./configure --prefix=/usr/local
make
sudo make install

Without the added "--prefix" argument git will currently install to "~/bin". This may or may not be what you want, in most distributions "~/bin" is not in the $PATH.[1] Without the --prefix, you might have to explicitly state the path to the component programs on invocation, ie: "~/bin/git-add foobar". You can set --prefix to whatever better suits your particular setup.

[edit] Git

The source can additionally be acquired via git using:

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

Or in the event you have problems with the default Git port of 9418:

git clone http://www.kernel.org/pub/scm/git/git.git

[edit] Msysgit (native)

Msysgit is the native Windows port of git using MinGW. You can find more information about Msysgit at: Msysgit on Google Code.

[edit] Footnotes

  1. ^  One effort to amend the lack of consistency through modern distributions and ~/bin, has been addressed by the Ubuntu developers which seeks to patch PAM, the authentication mechanism, to set up the environmental variable $PATH. You can find more information out about this at https://bugs.launchpad.net/ubuntu/+source/pam/+bug/64064.