|
NAMEgit-repository —
Git repository format
DESCRIPTIONA Git repository stores a series of versioned snapshots of a file hierarchy. Conceptually, the repository's data model is a directed acyclic graph which contains three types of objects as nodes:
Each object is identified by a SHA1 hash calculated over both the object's header and the data stored in the object. OBJECT STORAGELoose objects are stored as individual files beneath the directory objects, spread across 256 sub-directories named after the 256 possible hexadecimal values of the first byte of an object identifier. The name of the loose object file corresponds to the remaining hexadecimal byte values of the object's identifier.A loose object file begins with a header which specifies the type of object as an ASCII string, followed by an ASCII space character, followed by the object data's size encoded as an ASCII number string. The header is terminated by a NUL character, and the remainder of the file contains object data. Loose objects files are compressed with deflate(3). Multiple objects can be bundled in a pack file for better disk space efficiency and increased run-time performance. The pack file format introduces two additional types of objects:
Pack files are self-contained and may not refer to loose objects or objects stored in other pack files. Deltified objects may refer to other deltified objects as their delta base, forming chains of deltas. The ultimate base of a delta chain must be an object of the same type as the original object which is stored in deltified form. Each pack file is accompanied by a corresponding pack index file, which lists the IDs and offsets of all objects contained in the pack file. REFERENCESA reference associates a name with an object ID. A prominent use of references is providing names to branches in the repository by pointing at commit objects which represent the current tip commit of a branch. Because references may point to arbitrary object IDs, their use is not limited to branches.The name is a UTF-8 string with the following disallowed characters: ‘ ’ (space), ~ (tilde), ^ (caret), : (colon), ? (question mark), * (asterisk), [ (opening square bracket), \ (backslash). Additionally, the name may not contain the two-character sequences //, .. , and @{. Reference names may optionally have multiple components separated by the / (slash) character, forming a hierarchy of reference namespaces. Got reserves the got/ reference namespace for internal use. A symbolic reference associates a name with the name of another reference. The most prominent example is the HEAD reference which points at the name of the repository's default branch reference. References are stored either as a plain file within the repository, typically under the refs/ directory, or in the packed-refs file which contains one reference definition per line. Any object which is not directly or indirectly reachable via a
reference is subject to deletion by Git's garbage collector or
FILES
A typical Git repository exposes a work tree which allows the user to make changes to versioned files and create new commits. When a Git work tree is present, the actual repository data is stored in a .git subfolder of the repository's root directory. A Git repository without a work tree is known as a “bare” repository. got(1) does not make use of Git's work tree and treats every repository as if it was bare. SEE ALSOgot(1), gotadmin(1), deflate(3), SHA1(3), got-worktree(5), got.conf(5)HISTORYThe Git repository format was initially designed by Linus Torvalds in 2005 and has since been extended by various people involved in the development of the Git version control system.CAVEATSThe particular set of disallowed characters in reference names is a consequence of design choices made for the command-line interface of git(1). The same characters are disallowed by Got for compatibility purposes. Got additionally prevents users from creating reference names with a leading - (dash) character, because this is rarely intended and not considered useful.
Visit the GSP FreeBSD Man Page Interface. |