2 .\" Copyright (c) 2018 Stefan Sperling
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.
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.
21 .Nd Git repository browser
32 is an interactive read-only browser for Git repositories.
33 This repository format is described in
34 .Xr git-repository 5 .
37 supports several types of views which display repository data:
40 Displays commits in the repository's history.
41 This view is displayed initially if no
43 is specified, or if just a
47 Displays changes made in a particular commit.
49 Displays the line-by-line history of a file.
51 Displays the tree corresponding to a particular commit.
53 Displays references in the repository.
57 provides global and command-specific key bindings and options.
58 Some command-specific key bindings may be prefixed with an integer, which is
59 denoted by N in the descriptions below, and is used as a modifier to the
60 operation as indicated.
61 When the first integer for a count modifier is entered,
63 will wait 500 milliseconds for each successive integer or the compound sequence
65 If this sequence should timeout or does not conclude with a valid key binding,
66 the command is aborted and any preceding count is reset.
67 The global key bindings are:
73 Quit the view which is in focus.
75 Switch focus between views.
77 Toggle fullscreen mode for a split-screen view.
79 will automatically use split-screen views if the size of the terminal
80 window is sufficiently large.
83 Global options must precede the command name, and are as follows:
84 .Bl -tag -width tenletters
86 Display usage information.
88 Display program version and exit immediately.
95 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
96 Display history of a repository.
99 is specified, show only commits which modified this path.
100 If invoked in a work tree, the
102 is interpreted relative to the current working directory,
103 and the work tree's path prefix is implicitly prepended.
104 Otherwise, the path is interpreted relative to the repository root.
106 This command is also executed if no explicit command is specified.
110 are as follows (N denotes optional prefixed count modifier):
112 .It Cm Down-arrow, j, >, Full stop, Ctrl-n
113 Move the selection cursor down N lines (default: 1).
114 .It Cm Up-arrow, k, <, Comma, Ctrl-p
115 Move the selection cursor up N lines (default: 1).
116 .It Cm Right-arrow, l
117 Scroll log message field to the right N increments (default: 1).
119 Log message moves left on the screen.
121 Scroll log message field to the left N increments (default: 1).
123 Log message moves right on the screen.
125 Scroll log message field to the rightmost position.
127 Scroll log message field to the leftmost position.
128 .It Cm Page-down, Space, Ctrl+f, f
129 Move the selection cursor down N pages (default: 1).
130 .It Cm Page-up, Ctrl+b, b
131 Move the selection cursor up N pages (default: 1).
133 Move the selection cursor down N half pages (default: 1).
135 Move the selection cursor up N half pages (default: 1).
137 Move the cursor to the newest commit.
139 Move the cursor to the oldest commit.
140 This will traverse all commits on the current branch which may take
141 a long time depending on the number of commits in branch history.
142 If needed, this operation can be cancelled with
147 view showing file changes made in the currently selected commit.
151 view showing the tree for the currently selected commit.
153 Show log entries for the parent directory of the currently selected path.
154 However when an active search is in progress or when additional commits
157 aborts the running operation.
159 Prompt for a search pattern and start searching for matching commits.
160 The search pattern is an extended regular expression which is matched
161 against a commit's author name, committer name, log message, and
163 Regular expression syntax is documented in
166 Find the Nth next commit which matches the current search pattern (default: 1).
168 Searching continues until either a match is found or the
172 Find the Nth previous commit which matches the current search pattern
175 Searching continues until either a match is found or the
181 view with new commits found in the repository.
185 view and toggle display of merged commits.
188 option determines whether merged commits are displayed initially.
192 view listing all references in the repository.
193 This can then be used to open a new
195 view for arbitrary branches and tags.
203 Display individual commits which were merged into the current branch
207 shows the linear history of the current branch only.
210 key binding can be used to toggle display of merged commits at run-time.
212 Start traversing history at the specified
214 The expected argument is the name of a branch or a commit ID SHA1 hash.
215 An abbreviated hash argument will be expanded to a full SHA1 hash
216 automatically, provided the abbreviation is unique.
217 If this option is not specified, default to the work tree's current branch
218 if invoked in a work tree, or to the repository's HEAD reference.
219 .It Fl r Ar repository-path
220 Use the repository at the specified path.
221 If not specified, assume the repository is located at or above the current
223 If this directory is a
225 work tree, use the repository path associated with this work tree.
227 .It Cm diff Oo Fl a Oc Oo Fl C Ar number Oc Oo Fl r Ar repository-path Oc Oo Fl w Oc Ar object1 Ar object2
228 Display the differences between two objects in the repository.
229 Treat each of the two arguments as a reference, a tag name, or an object
230 ID SHA1 hash, and display differences between the corresponding objects.
231 Both objects must be of the same type (blobs, trees, or commits).
232 An abbreviated hash argument will be expanded to a full SHA1 hash
233 automatically, provided the abbreviation is unique.
237 are as follows (N denotes optional prefixed count modifier):
240 Toggle treatment of file contents as ASCII text even if binary data was
242 .It Cm Down-arrow, j, Ctrl-n
243 Scroll down N lines (default: 1).
244 .It Cm Up-arrow, k, Ctrl-p
245 Scroll up N lines (default: 1).
246 .It Cm Right-arrow, l
247 Scroll view to the right N increments (default: 1).
249 Diff output moves left on the screen.
251 Scroll view to the left N increments (default: 1).
253 Diff output moves right on the screen.
255 Scroll view to the rightmost position.
257 Scroll view left to the start of the line.
258 .It Cm Page-down, Space, Ctrl+f, f
259 Scroll down N pages (default: 1).
260 .It Cm Page-up, Ctrl+b, b
261 Scroll up N pages (default: 1).
263 Scroll down N half pages (default: 1).
265 Scroll up N half pages (default: 1).
267 Scroll to the top of the view.
269 Scroll to the bottom of the view.
271 Reduce diff context by N lines (default: 1).
273 Increase diff context by N lines (default: 1).
277 view was opened via the
279 view, move to the Nth previous (younger) commit (default: 1).
283 view was opened via the
285 view, move to the Nth next (older) commit (default: 1).
287 Prompt for a search pattern and start searching for matching lines.
288 The search pattern is an extended regular expression.
289 Regular expression syntax is documented in
292 Find the Nth next line which matches the current search pattern (default: 1).
294 Find the Nth previous line which matches the current search pattern
297 Toggle display of whitespace-only changes.
305 Treat file contents as ASCII text even if binary data is detected.
307 Set the number of context lines shown in the diff.
308 By default, 3 lines of context are shown.
309 .It Fl r Ar repository-path
310 Use the repository at the specified path.
311 If not specified, assume the repository is located at or above the current
313 If this directory is a
315 work tree, use the repository path associated with this work tree.
317 Ignore whitespace-only changes.
319 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
320 Display line-by-line history of a file at the specified path.
324 are as follows (N denotes optional prefixed count modifier):
326 .It Cm Down-arrow, j, Ctrl-n
327 Move the selection cursor down N pages (default: 1).
328 .It Cm Up-arrow, k, Ctrl-p
329 Move the selection cursor up N pages (default: 1).
330 .It Cm Right-arrow, l
331 Scroll view to the right N increments (default: 1).
333 File output moves left on the screen.
335 Scroll view to the left N increments (default: 1).
337 File output moves right on the screen.
339 Scroll view to the rightmost position.
341 Scroll view left to the start of the line.
342 .It Cm Page-down, Space, Ctrl+f, f
343 Move the selection cursor down N pages (default: 1).
344 .It Cm Page-up, Ctrl+b, b
345 Move the selection cursor up N pages (default: 1).
347 Move the selection cursor down N half pages (default: 1).
349 Move the selection cursor up N half pages (default: 1).
351 Move the selection cursor to the first line of the file.
353 Move the selection cursor to the last line of the file.
357 view for the currently selected line's commit.
361 view with the version of the file as found in the currently
362 selected line's commit.
366 view with the version of the file as found in the parent commit of the
367 currently selected line's commit.
371 view with the previously blamed commit.
373 Prompt for a search pattern and start searching for matching lines.
374 The search pattern is an extended regular expression.
375 Regular expression syntax is documented in
378 Find the Nth next line which matches the current search pattern (default: 1).
380 Find the Nth previous line which matches the current search pattern
389 Start traversing history at the specified
391 The expected argument is the name of a branch or a commit ID SHA1 hash.
392 An abbreviated hash argument will be expanded to a full SHA1 hash
393 automatically, provided the abbreviation is unique.
394 .It Fl r Ar repository-path
395 Use the repository at the specified path.
396 If not specified, assume the repository is located at or above the current
398 If this directory is a
400 work tree, use the repository path associated with this work tree.
402 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
403 Display the repository tree.
406 is specified, show tree entries at this path.
408 Displayed tree entries may carry one of the following trailing annotations:
409 .Bl -column YXZ description
410 .It @ Ta entry is a symbolic link
411 .It / Ta entry is a directory
412 .It * Ta entry is an executable file
413 .It $ Ta entry is a Git submodule
416 Symbolic link entries are also annotated with the target path of the link.
420 are as follows (N denotes optional prefixed count modifier):
422 .It Cm Down-arrow, j, Ctrl-n
423 Move the selection cursor down N lines (default: 1).
424 .It Cm Up-arrow, k, Ctrl-p
425 Move the selection cursor up N lines (default: 1).
426 .It Cm Page-down, Space, Ctrl+f, f
427 Move the selection cursor down N pages (default: 1).
428 .It Cm Page-up, Ctrl+b, b
429 Move the selection cursor up N pages (default: 1).
431 Move the selection cursor down N half pages (default: 1).
433 Move the selection cursor up N half pages (default: 1).
435 Move the selection cursor to the first entry.
437 Move the selection cursor to the last entry.
439 Enter the currently selected directory, or switch to the
441 view for the currently selected file.
445 view for the currently selected tree entry.
449 view listing all references in the repository.
450 This can then be used to open a new
452 view for arbitrary branches and tags.
454 Move back to the Nth parent directory (default: 1).
456 Show object IDs for all objects displayed in the
460 Prompt for a search pattern and start searching for matching tree entries.
461 The search pattern is an extended regular expression which is matched
462 against the tree entry's name.
463 Regular expression syntax is documented in
466 Find the Nth next tree entry which matches the current search pattern
469 Find the Nth previous tree entry which matches the current search pattern
478 Start traversing history at the specified
480 The expected argument is the name of a branch or a commit ID SHA1 hash.
481 An abbreviated hash argument will be expanded to a full SHA1 hash
482 automatically, provided the abbreviation is unique.
483 .It Fl r Ar repository-path
484 Use the repository at the specified path.
485 If not specified, assume the repository is located at or above the current
487 If this directory is a
489 work tree, use the repository path associated with this work tree.
491 .It Cm ref Oo Fl r Ar repository-path Oc
492 Display references in the repository.
496 are as follows (N denotes optional prefixed count modifier):
498 .It Cm Down-arrow, j, Ctrl-n
499 Move the selection cursor down N lines (default: 1).
500 .It Cm Up-arrow, k, Ctrl-p
501 Move the selection cursor up N lines (default: 1).
502 .It Cm Page-down, Space, Ctrl+f, f
503 Move the selection cursor down N pages (default: 1).
504 .It Cm Page-up, Ctrl+b, b
505 Move the selection cursor up N pages (default: 1).
507 Move the selection cursor down N half pages (default: 1).
509 Move the selection cursor up N half pages (default: 1).
511 Move the selection cursor to the first reference.
513 Move the selection cursor to the last reference.
517 view which begins traversing history at the commit resolved via the
518 currently selected reference.
522 view showing the tree resolved via the currently selected reference.
524 Show object IDs for all non-symbolic references displayed in the
528 Show last modified date of each displayed reference.
530 Toggle display order of references between sort by name and sort by timestamp.
532 Prompt for a search pattern and start searching for matching references.
533 The search pattern is an extended regular expression which is matched
534 against absolute reference names.
535 Regular expression syntax is documented in
538 Find the Nth next reference which matches the current search pattern
541 Find the Nth previous reference which matches the current search pattern
544 Reload the list of references displayed by the
553 .It Fl r Ar repository-path
554 Use the repository at the specified path.
555 If not specified, assume the repository is located at or above the current
557 If this directory is a
559 work tree, use the repository path associated with this work tree.
563 .Bl -tag -width TOG_COLORS
566 shows colorized output if this variable is set to a non-empty value.
567 The default color scheme can be modified by setting the environment
568 variables documented below.
569 The colors available in color schemes are
579 which maps to the terminal's default foreground color.
580 .It Ev TOG_COLOR_DIFF_MINUS
581 The color used to mark up removed lines in diffs.
582 If not set, the default value
585 .It Ev TOG_COLOR_DIFF_PLUS
586 The color used to mark up added lines in diffs.
587 If not set, the default value
590 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
591 The color used to mark up chunk header lines in diffs.
592 If not set, the default value
595 .It Ev TOG_COLOR_DIFF_META
596 The color used to mark up meta data in diffs.
597 If not set, the default value
600 .It Ev TOG_COLOR_TREE_SUBMODULE
601 The color used to mark up submodule tree entries.
602 If not set, the default value
605 .It Ev TOG_COLOR_TREE_SYMLINK
606 The color used to mark up symbolic link tree entries.
607 If not set, the default value
610 .It Ev TOG_COLOR_TREE_DIRECTORY
611 The color used to mark up directory tree entries.
612 If not set, the default value
615 .It Ev TOG_COLOR_TREE_EXECUTABLE
616 The color used to mark up executable file tree entries.
617 If not set, the default value
620 .It Ev TOG_COLOR_COMMIT
621 The color used to mark up commit IDs.
622 If not set, the default value
625 .It Ev TOG_COLOR_AUTHOR
626 The color used to mark up author information.
627 If not set, the default value
630 .It Ev TOG_COLOR_DATE
631 The color used to mark up date information.
632 If not set, the default value
635 .It Ev TOG_COLOR_REFS_HEADS
636 The color used to mark up references in the
639 If not set, the default value
642 .It Ev TOG_COLOR_REFS_TAGS
643 The color used to mark up references in the
646 If not set, the default value
649 .It Ev TOG_COLOR_REFS_REMOTES
650 The color used to mark up references in the
653 If not set, the default value
656 .It Ev TOG_COLOR_REFS_BACKUP
657 The color used to mark up references in the
660 If not set, the default value
668 .Xr git-repository 5 ,
671 .An Stefan Sperling Aq Mt stsp@openbsd.org
672 .An Joshua Stein Aq Mt jcs@openbsd.org