Blame


1 5e5560e1 2018-08-01 stsp .\"
2 5e5560e1 2018-08-01 stsp .\" Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 5e5560e1 2018-08-01 stsp .\"
4 5e5560e1 2018-08-01 stsp .\" Permission to use, copy, modify, and distribute this software for any
5 5e5560e1 2018-08-01 stsp .\" purpose with or without fee is hereby granted, provided that the above
6 5e5560e1 2018-08-01 stsp .\" copyright notice and this permission notice appear in all copies.
7 5e5560e1 2018-08-01 stsp .\"
8 5e5560e1 2018-08-01 stsp .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 5e5560e1 2018-08-01 stsp .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 5e5560e1 2018-08-01 stsp .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 5e5560e1 2018-08-01 stsp .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 5e5560e1 2018-08-01 stsp .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 5e5560e1 2018-08-01 stsp .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 5e5560e1 2018-08-01 stsp .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 5e5560e1 2018-08-01 stsp .\"
16 5e5560e1 2018-08-01 stsp .Dd $Mdocdate$
17 5e5560e1 2018-08-01 stsp .Dt GIT-REPOSITORY 5
18 5e5560e1 2018-08-01 stsp .Os
19 5e5560e1 2018-08-01 stsp .Sh NAME
20 5e5560e1 2018-08-01 stsp .Nm git-repository
21 5e5560e1 2018-08-01 stsp .Nd git repository format
22 5e5560e1 2018-08-01 stsp .Sh DESCRIPTION
23 5e5560e1 2018-08-01 stsp A git repository stores a series of versioned snapshots of a file hierarchy.
24 5e5560e1 2018-08-01 stsp .Pp
25 5e5560e1 2018-08-01 stsp The repository's core data model is a directed acyclic graph which
26 5e5560e1 2018-08-01 stsp contains three types of objects as nodes.
27 5e5560e1 2018-08-01 stsp Each object is identified by the SHA-1 hash calculated over the object's
28 5e5560e1 2018-08-01 stsp header plus the content stored in the object.
29 5e5560e1 2018-08-01 stsp The object header names the type of object in an ASCII string, which is
30 5e5560e1 2018-08-01 stsp followed by a space, followed by the size of data in the object encoded
31 5e5560e1 2018-08-01 stsp as an ASCII number string.
32 5e5560e1 2018-08-01 stsp This header is terminated by a
33 5e5560e1 2018-08-01 stsp .Sy NUL
34 5e5560e1 2018-08-01 stsp character.
35 5e5560e1 2018-08-01 stsp .Pp
36 5e5560e1 2018-08-01 stsp The content of tracked files is stored in objects of type
37 5e5560e1 2018-08-01 stsp .Em blob .
38 5e5560e1 2018-08-01 stsp .Pp
39 5e5560e1 2018-08-01 stsp A
40 5e5560e1 2018-08-01 stsp .Em tree
41 5e5560e1 2018-08-01 stsp object points to any number of such blobs, and also to other trees in
42 5e5560e1 2018-08-01 stsp order to form a hierarchy of files and directories.
43 5e5560e1 2018-08-01 stsp .Pp
44 5e5560e1 2018-08-01 stsp A
45 5e5560e1 2018-08-01 stsp .Em commit
46 5e5560e1 2018-08-01 stsp object points to the root element of one tree, and thus records the
47 5e5560e1 2018-08-01 stsp state of this entire tree as a snapshot.
48 5e5560e1 2018-08-01 stsp Commit objects are chained together and thus form a line of history
49 5e5560e1 2018-08-01 stsp of snapshots.
50 5e5560e1 2018-08-01 stsp A given commit can be suceeded by an arbitrary number of subsequent commits,
51 5e5560e1 2018-08-01 stsp such that diverging lines of version control history, known as
52 5e5560e1 2018-08-01 stsp .Em branches ,
53 5e5560e1 2018-08-01 stsp can be represented.
54 5e5560e1 2018-08-01 stsp A commit which preceeds another commit is referred to as that other commit's
55 5e5560e1 2018-08-01 stsp .Em parent commit .
56 5e5560e1 2018-08-01 stsp A commit with multiple parents reunites diverged lines of history and is
57 5e5560e1 2018-08-01 stsp known as a
58 5e5560e1 2018-08-01 stsp .Em merge commit .
59 5e5560e1 2018-08-01 stsp While the data model allows for commits with an arbitrary number of
60 5e5560e1 2018-08-01 stsp parent commits,
61 5e5560e1 2018-08-01 stsp .Xr got 1
62 5e5560e1 2018-08-01 stsp restricts all commits to at most 2 parents in order to discourage chaotic
63 5e5560e1 2018-08-01 stsp branching and merging practices.
64 5e5560e1 2018-08-01 stsp .Pp
65 5e5560e1 2018-08-01 stsp When stored on disk, all objects are compressed with
66 5e5560e1 2018-08-01 stsp .Xr deflate 3 .
67 5e5560e1 2018-08-01 stsp Mulitple objects may be stored together in a
68 5e5560e1 2018-08-01 stsp .Em pack file
69 5e5560e1 2018-08-01 stsp which provides for deltification of object content.
70 5e5560e1 2018-08-01 stsp .Sh FILES
71 5e5560e1 2018-08-01 stsp .Bl -tag -width /etc/rpc -compact
72 5e5560e1 2018-08-01 stsp .It Pa HEAD
73 5e5560e1 2018-08-01 stsp .It Pa ORIG_HEAD
74 5e5560e1 2018-08-01 stsp .It Pa FETCH_HEAD
75 5e5560e1 2018-08-01 stsp .It Pa branches/
76 5e5560e1 2018-08-01 stsp .It Pa config
77 5e5560e1 2018-08-01 stsp .It Pa description
78 5e5560e1 2018-08-01 stsp .It Pa hooks/
79 5e5560e1 2018-08-01 stsp .It Pa index
80 5e5560e1 2018-08-01 stsp .It Pa info
81 5e5560e1 2018-08-01 stsp .It Pa logs/
82 5e5560e1 2018-08-01 stsp .It Pa objects/
83 5e5560e1 2018-08-01 stsp .It Pa packed-refs
84 5e5560e1 2018-08-01 stsp .It Pa refs/
85 5e5560e1 2018-08-01 stsp .El
86 5e5560e1 2018-08-01 stsp .Sh SEE ALSO
87 5e5560e1 2018-08-01 stsp .Xr got 1 ,
88 5e5560e1 2018-08-01 stsp .Xr deflate 3 ,
89 5e5560e1 2018-08-01 stsp .Xr got-worktree 5
90 5e5560e1 2018-08-01 stsp .Sh HISTORY
91 5e5560e1 2018-08-01 stsp The Git repository format was designed by Linus Torvalds in 2005.