Blob


1 .\"
2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018 Stefan Sperling
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate$
18 .Dt GOT 1
19 .Os
20 .Sh NAME
21 .Nm got
22 .Nd version control system
23 .Sh SYNOPSIS
24 .Nm
25 .Ar command
26 .Op Fl h
27 .Op Ar arg ...
28 .Sh DESCRIPTION
29 .Nm
30 is a version control system which prioritizes ease of use and simplicity
31 over flexibility.
32 .Pp
33 .Nm
34 stores the history of tracked files in a repository which uses
35 the same on-disk format as
36 .Dq bare
37 repositories used by the Git version control system.
38 This repository format is described in
39 .Xr got-repository 5 .
40 .Pp
41 .Nm
42 is a
43 .Em distributed
44 version control system because every copy of a repository is writeable.
45 Modifications made to files can be synchronized between repositories
46 at any time.
47 .Pp
48 Files managed by
49 .Nm
50 must be checked out from the repository for modification.
51 Checked out files are stored in a
52 .Em work tree
53 which can be placed at an arbitrary directory in the filesystem hierarchy.
54 The on-disk format of a
55 .Nm
56 work tree is described in
57 .Xr got-worktree 5 .
58 .Pp
59 .Nm
60 provides global and command-specific options.
61 Global options must preceed the command name, and are as follows:
62 .Bl -tag -width tenletters
63 .It Fl h
64 Display usage information.
65 .El
66 .Pp
67 The commands are as follows:
68 .Bl -tag -width checkout
69 .It Cm checkout [ Fl p Ar path-prefix ] repository-path [ work-tree-path ]
70 Copy files from a repository into a new work tree.
71 The work tree may be restricted to a subset of the repository's tree
72 hierarchy by specifying the
73 .Fl p Ar path-prefix
74 option.
75 In this case, only files beneath the specified prefix will
76 be checked out.
77 If the
78 .Ar work tree path
79 is not specified, either use the base name of the
80 .Ar repository path ,
81 or if a
82 .Ar path prefix
83 was specified use the base name of the
84 .Ar path prefix .
85 .\".It Cm status
86 .\"Show current status of files.
87 .It Cm log [ Fl p ] [ Fl c Ar commit ] [ Fl l Ar N ] [ Fl v ] [ Ar repository-path ]
88 Display history of the repository.
89 If the
90 .Fl p
91 option is given, display the patch of modifications made in each commit.
92 If a
93 .Ar commit
94 is specified with the
95 .Fl c
96 option, start traversing history at this commit.
97 The
98 .Ar commit
99 argument is a SHA1 hash which corresponds to the commit object.
100 The
101 .Fl l
102 option limits the output to a number of
103 .Ar N
104 commits.
105 The
106 .Fl v
107 option enables verbose output.
108 If the
109 .Ar repository path
110 is omitted, use the current working directory.
111 .It Cm diff [ Ar repository-path ] Ar object1 Ar object2
112 Display the differences between two objects in the repository.
113 Each
114 .Ar object
115 argument is a SHA1 hash which corresponds to the object.
116 Both objects must be of the same type (blobs, trees, or commits).
117 If the
118 .Ar repository path
119 is omitted, use the current working directory.
120 .El
121 .Sh EXIT STATUS
122 .Ex -std got
123 .Sh EXAMPLES
124 Check out a work tree of
125 .Ox
126 kernel sources from a Git repository at /var/repo/openbsd-src to ~/sys:
127 .Pp
128 .Dl $ got checkout -p sys /var/repo/openbsd-src ~/sys
129 .Sh SEE ALSO
130 .Xr got-repository 5
131 .Xr got-worktree 5
132 .Sh AUTHORS
133 .An Stefan Sperling Aq Mt stsp@openbsd.org
134 .An Martin Pieuchot Aq Mt mpi@openbsd.org