Jump to content

Git: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Fredrik (talk | contribs)
No edit summary
Fredrik (talk | contribs)
wikipedia is not a dictionary
Line 35: Line 35:
** [http://kerneltrap.org/node/5026 Git Web Interfaces]
** [http://kerneltrap.org/node/5026 Git Web Interfaces]
*[http://www.pcworld.idg.com.au/index.php/id;1852076002;fp;16;fpid;0 PC World] "Torvalds seemed aware that his decision to drop BitKeeper would also be controversial. When asked why he called the new software, "git," [[British English|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.'"
*[http://www.pcworld.idg.com.au/index.php/id;1852076002;fp;16;fpid;0 PC World] "Torvalds seemed aware that his decision to drop BitKeeper would also be controversial. When asked why he called the new software, "git," [[British English|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.'"

----

In [[British English|British]] slang, '''''git''''' means a foolish or worthless person. It is moderately derogatory.

Revision as of 12:48, 23 April 2005

In computing, Git is an open source project started by Linus Torvalds to manage the Linux kernel. It was first released on April 7, 2005, shortly after he dropped the proprietary BitKeeper software after a controversy where the developer Andrew Tridgell attempted to reverse engineer the BitKeeper protocols.

Like BitKeeper, Git does not use a centralized server. However, Git is not a SCM system. Torvalds explains, "in many ways you can just see git as a filesystem - it's content-addressable, and it has a notion of versioning, but I really really designed it coming at the problem from the viewpoint of a _filesystem_ person (hey, kernels is what I do), and I actually have absolutely _zero_ interest in creating a traditional SCM system."

Git has two data structures: an object database and a directory cache. There are three types of objects:

  • A blob object is the content of a file.
  • A tree object is a list of blob objects and any information associated with each blob object, such as the file name and file permission. This object describes the source tree at a certain time.
  • A commit object provides the history of the source tree. It contains a log message, a tree object, and pointers to one or more parent commit objects.

The object database can hold any kind of object. The directory cache holds a tree object; it may or may not reflect the current state of the source tree.

Each object is distinguished by a SHA1 hash. The object is first compressed by zlib and a hash is calculated. The object is put into a directory matching the first two characters of its hash. The rest of the hash is used as the file name for that object.

Git does not use delta compression. Instead it stores each revision of a file as a unique blob object. The relationships between the blobs can be found through examining the commit objects. Since Git stores each revision as whole files, the source tree may consume a large amount of hard disk space quickly. In response to Git's inefficiency, Larry McVoy, the creator of BitKeeper, says, "a tiny one-character change to a 1MB file in Git will result in a 2MB file, whereas BitKeeper's file will grow only by one byte." [1]

Git has the following commands:

  • initdb creates a new repository.
  • update-cache --add adds new blob objects to the object database for any file that has been changed since the last commit. The old blob objects are left intact.
  • write-tree creates a new tree object from the directory cache and adds it into the object database. It outputs the checksum of the tree object.
  • commit-tree takes in the checksum of a tree object and the checksums of the parent commit objects. It will create a new commit object.

Petr Baudis maintains a set of scripts called git-pasky, a revision control system that uses Git as its backend.

As of April 2005, there are two web interfaces for Git:

  • gitweb – a Perl implementation maintained by Kay Sievers.
  • wit – a Python implementation maintained by Christian Meder.