Penguin
Annotated edit history of Git version 23, including all changes. View license author blame.
Rev Author # Line
19 AristotlePagaltzis 1 [Git] is an OpenSource [DVCS] (although it originally started as just a storage backend). It was initially written by LinusTorvalds for the needs of the LinuxKernel developers, but due to a clever but simple internal design it can be tailored to nearly any development workflot. It is itself kept [in a Git repository | http://master.kernel.org/git/?p=git/git.git;a=summary]. The project 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 VersionControlSystem~s were found inadequate.
16 AristotlePagaltzis 2
3 > 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."
4 From [PC World: After controversy, Torvalds begins work on "git" | http://www.pcworld.idg.com.au/index.php/id;1852076002]
5
6 !!! Design
10 AristotlePagaltzis 7
8 [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 VersionControlSystem~s. 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 VersionControlSystem~s, 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.
18 AristotlePagaltzis 9
10 The main [Git] ManPage describes it as “the stupid content tracker”. What this means is that the repository format is designed to store only file and directory contents (known as a tree) but not store information about how trees arrived at their state. F.ex. deleting a file and then untracking it in [Git] is identical to using <tt>git rm</tt>, an operation that is special in many other [VCS]s. While this means that algorithms like rename tracking and merge conflict resolution must initially get by with less information, it also means that as that as they become more intelligent, all of the history benefits, not just history recorded recently enough to have the necessary metadata. It also means that all workflows are created equal.
10 AristotlePagaltzis 11
16 AristotlePagaltzis 12 [Git] has two main ways of transferring data. Its native application protocol is implemented by the <tt>git fetch-pack</tt> and <tt>git upload-pack</tt> commands, but [Git] can also crawl the files in the remote repository's object store without reliance on server-side intelligence. There are a number of transport protocols:
12 IanMcDonald 13
16 AristotlePagaltzis 14 * The most efficient transport protocol is called <tt>git://</tt>, which is merely a thin [TCP] wrapper around the application protocol, commonly using [Port] 9418. However it has no built-in access control so usually does not allow pushing, although it can.
15 * The default transport protocol is <tt>~ssh://</tt>. This tunnels the native protocol over [SSH]. Pushing is generally possible.
16 * On servers without [Git] installed, you should probably use rsync(1). Again, pushing is usually possible.
17 * Lastly, the slowest option is to simply publish the repository via [HTTP]. If the WebServer supports WebDav, it can even accept pushes.
13 IanMcDonald 18
16 AristotlePagaltzis 19 Note that when using a dumb transport, you must ensure that <tt>git update-server-info</tt> is run in the repository any time someone commits to it (eg. by setting up a hook). This maintains a static file with a stored index of the state of the repository which would be dynamically negotiated between <tt>git fetch-pack</tt> and <tt>git upload-pack</tt> in smart transports.
17 LawrenceDoliveiro 20
16 AristotlePagaltzis 21 !!! Notes
22
23 You may encounter the following error:
13 IanMcDonald 24
25 <verbatim>
26 *** Environment problem:
27 *** Your name cannot be determined from your system services (gecos).
28 *** You would need to set GIT_AUTHOR_NAME and GIT_COMMITTER_NAME
29 *** environment variables; otherwise you won't be able to perform
30 *** certain operations because of "empty ident" errors.
31 *** Alternatively, you can use user.name configuration variable.
32
33 fatal: empty ident <user@machine.localdomain> not allowed
34 </verbatim>
35
16 AristotlePagaltzis 36 This means your RealName is not properly set up in the system user accounts list (<tt>/etc/passwd</tt>, specifically the [gecos field | WikiPedia:gecos_field] for your account), which [Git] uses by default. You can either fix that or configure [Git] itself:
13 IanMcDonald 37
16 AristotlePagaltzis 38 <verbatim>
39 git config --global user.name Joe Random Hacker
40 git config --global user.email jrh@example.org
41 </verbatim>
15 IanMcDonald 42
16 AristotlePagaltzis 43 This will set your default username (saved in <tt>~~/.gitconfig</tt>). Alternatively you can set your username specifically for a particular repository (stored in <tt>projectroot/.git/config</tt>) by omitting the <tt>--global</tt> switch.
15 IanMcDonald 44
16 AristotlePagaltzis 45 !! Installing [Git] documentation when compiling from source
15 IanMcDonald 46
16 AristotlePagaltzis 47 You need to build it separately:
15 IanMcDonald 48
49 <verbatim>
50 make doc
51 make install-doc
52 </verbatim>
53
16 AristotlePagaltzis 54 Note that it depends on quite a few extra tools, so you may need to install extra [Package]s on your machine. In particular <tt>asciidoc</tt> must be at least version 7 unless you want to hack the MakeFile~s. If you are running DebianLinux Sarge you will need to take this from testing. See AptNotes for more details on how to do this.
15 IanMcDonald 55
16 AristotlePagaltzis 56 Alternatively the ManPage~s can be found online at http://www.kernel.org/pub/software/scm/git/docs/
15 IanMcDonald 57
58 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/].
59
16 AristotlePagaltzis 60 !!! See also
15 IanMcDonald 61
16 AristotlePagaltzis 62 * KernelDevelopmentWithGit
20 LawrenceDoliveiro 63 * [Why Git Is Better Than X|http://whygitisbetterthanx.com/]
21 LawrenceDoliveiro 64
65 ----
23 LawrenceDoliveiro 66 CategoryVersionControl

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 3 times)