Penguin
Note: You are viewing an old revision of this page. View the current version.

Git is a storage backend for a VersionControlSystem, written by LinusTorvalds and tailored to the needs of the LinuxKernel developers. It was born of necessity when BitKeeper's licence was changed such that it was no longer an acceptable home for the LinuxKernel, but all other VersionControlSystems were found inadequate.

Git's primary design objective is to keep the computational effort of committing a patch proportional to the size of the patch, rather than the size of the repository, as would be the case with most VersionControlSystems. This is achieved by keeping every version of every object (ie a file in a directory), compressed using ZLib and identified by its SHA1 sum. Contrary to traditional VersionControlSystems, this makes building a history for a single object computationally expensive, while at the same time making getting a view of any particular revision of the repository as a whole very cheap.

To create the Git documentation you need to do:

make doc
make install-doc

You may need to install extra packages on your machine as it has quite a few requirements. In particular asciidoc must be at least version 7 unless you want to hack the MakeFiles. If you are running DebianLinux Sarge you will need to take this from testing. See AptNotes for more details on how to do this.

Alternatively the man pages can be found at http://www.kernel.org/pub/software/scm/git/docs/ if you don't have permissions to install locally from the Git Package (although you can always have local man pages if you setup your enivronment variables correctly).

Git is OpenSource and itself kept in a Git archive available at rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/git.git. This now includes gitk which is quite a useful tool for viewing what's inside a Git graphically. To be able to use Git, you need to bootstrap your installation using the TarBall at http://www.codemonkey.org.uk/projects/git-snapshots/git/.

These days most distributions have Git prepackaged although they are often only for the development version as still relatively new.

Git has a number of ways to transfer the data. The most efficient is it's native protocol called Git which uses TCP port 9418. It can also use rsync and HTTP.


If you get the following error:

*** Environment problem:
*** Your name cannot be determined from your system services (gecos).
*** You would need to set GIT_AUTHOR_NAME and GIT_COMMITTER_NAME
*** environment variables; otherwise you won't be able to perform
*** certain operations because of "empty ident" errors.
*** Alternatively, you can use user.name configuration variable.

fatal: empty ident  <user@machine.localdomain> not allowed

then you need to setup your real name in the system password file (/etc/passwd). gecos refers to this field in this case (see wikipedia:gecos for more info).

NB Putting those environment variables won't fix it if you don't have the real name in!


Torvalds seemed aware that his decision to drop BitKeeper would also be controversial. When asked why he called the new software, "git," British slang meaning "a rotten person," he said. "I'm an egotistical bastard, so I name all my projects after myself. First Linux, now git."

From PC World: After controversy, Torvalds begins work on "git"


See also KernelDevelopmentWithGit