Blob


1 .\"
2 .\" Copyright (c) 2017 Martin Pieuchot
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 1
18 .Os
19 .Sh NAME
20 .Nm got
21 .Nd version control system
22 .Sh SYNOPSIS
23 .Nm
24 .Ar command
25 .Op Fl h
26 .Op Ar arg ...
27 .Sh DESCRIPTION
28 .Nm
29 is a version control system which prioritizes ease of use and simplicity
30 over flexibility.
31 .Pp
32 .Nm
33 stores the history of tracked files in a repository which happens to use
34 the same on-disk format as
35 .Dq bare
36 repositories used by the popular Git version control system.
37 This repository format is described in
38 .Xr got-repository 5 .
39 .Pp
40 .Nm
41 is a
42 .Em distributed
43 version control system because every copy of a repository is writeable.
44 Modifications made to files can be synchronized between repositories
45 at any time.
46 .Pp
47 Files managed by
48 .Nm
49 must be checked out from the repository for modification.
50 Checked out files are stored in a
51 .Em work tree
52 which can be placed at an arbitrary directory in the filesystem hierarchy.
53 The on-disk format of a
54 .Nm
55 work tree is described in
56 .Xr got-worktree 5 .
57 .Pp
58 .Nm
59 provides global and command-specific options.
60 Global options must preceed the command name, and are as follows:
61 .Bl -tag -width tenletters
62 .It Fl h
63 Display usage information.
64 .El
65 .Pp
66 The commands are as follows:
67 .Bl -tag -width checkout
68 .It Cm checkout [ Fl p Ar path-prefix ] repository-path [ work-tree-path ]
69 Copy files from a repository into a new work tree.
70 The work tree may be restricted to a subset of the repository's tree
71 hierarchy by specifying the
72 .Fl p Ar path-prefix
73 option.
74 In this case, only files beneath the specified prefix will
75 be checked out.
76 If the
77 .Ar work tree path
78 is not specified, either use the base name of the
79 .Ar repository path ,
80 or if a
81 .Ar path prefix
82 was specified use the base name of the
83 .Ar path prefix .
84 .\".It Cm status
85 .\"Show current status of files.
86 .It Cm log [ Fl p ] [ Fl c Ar commit ] [ Fl l Ar N ] [ Ar repository-path ]
87 Display history of the repository.
88 If the
89 .Fl p
90 option is given, display the patch of modifications made in each commit.
91 If a
92 .Ar commit
93 is specified with the
94 .Fl c
95 option, start traversing history at this commit.
96 The
97 .Fl l
98 option limits the output to a number of
99 .Ar N
100 commits.
101 If the
102 .Ar repository path
103 is omitted, use the current working directory.
104 .It Cm diff [ Ar repository-path ] Ar object1 Ar object2
105 Display the differences between two objects in the repository.
106 Both objects must be of the same type (blobs, trees, or commits).
107 If the
108 .Ar repository path
109 is omitted, use the current working directory.
110 .El
111 .Sh EXIT STATUS
112 .Ex -std got
113 .Sh EXAMPLES
114 Check out a work tree of
115 .Ox
116 kernel sources from a Git repository at /var/repo/openbsd-src to ~/sys:
117 .Pp
118 .Dl $ got checkout -p sys /var/repo/openbsd-src ~/sys
119 .Sh SEE ALSO
120 .Xr got-repository 5
121 .Xr got-worktree 5