Blob


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