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.
62 will echo digits to the screen when count modifiers are entered, and complete
63 the sequence upon input of the first non-numeric character.
64 Count modifiers can be aborted by entering an unmapped key.
65 Once a compound command is executed, the operation can be cancelled with
70 The global key bindings are:
76 Quit the view which is in focus.
78 Switch focus between views.
80 Toggle fullscreen mode for a split-screen view.
82 will automatically use vertical split-screen views if the size of the
83 terminal window is sufficiently large.
85 Switch the current split-screen layout, and render all active views in
87 The split-screen layout can be either vertical or horizontal.
88 If the terminal is not wide enough when switching to a vertical split,
89 views will render in fullscreen.
91 When in a split-screen view, decrease the size of the focussed split
92 N increments (default: 1).
94 When in a split-screen view, increase the size of the focussed split
95 N increments (default: 1).
98 Global options must precede the command name, and are as follows:
99 .Bl -tag -width tenletters
101 Display usage information.
103 Display program version and exit immediately.
109 .Bl -tag -width blame
110 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
111 Display history of a repository.
114 is specified, show only commits which modified this path.
115 If invoked in a work tree, the
117 is interpreted relative to the current working directory,
118 and the work tree's path prefix is implicitly prepended.
119 Otherwise, the path is interpreted relative to the repository root.
121 This command is also executed if no explicit command is specified.
125 are as follows (N denotes optional prefixed count modifier):
127 .It Cm Down-arrow, j, >, Full stop, Ctrl-n
128 Move the selection cursor down N lines (default: 1).
129 .It Cm Up-arrow, k, <, Comma, Ctrl-p
130 Move the selection cursor up N lines (default: 1).
131 .It Cm Right-arrow, l
132 Scroll log message field to the right N increments (default: 1).
134 Log message moves left on the screen.
136 Scroll log message field to the left N increments (default: 1).
138 Log message moves right on the screen.
140 Scroll log message field to the rightmost position.
142 Scroll log message field to the leftmost position.
143 .It Cm Page-down, Space, Ctrl+f, f
144 Move the selection cursor down N pages (default: 1).
145 .It Cm Page-up, Ctrl+b, b
146 Move the selection cursor up N pages (default: 1).
148 Move the selection cursor down N half pages (default: 1).
150 Move the selection cursor up N half pages (default: 1).
152 Move the cursor to the newest commit.
154 Move the cursor to the oldest commit.
155 This will traverse all commits on the current branch which may take
156 a long time depending on the number of commits in branch history.
157 If needed, this operation can be cancelled with
164 view showing file changes made in the currently selected commit.
168 view showing the tree for the currently selected commit.
170 Show log entries for the parent directory of the currently selected path.
171 However when an active search is in progress or when additional commits
174 aborts the running operation.
176 Prompt for a search pattern and start searching for matching commits.
177 The search pattern is an extended regular expression which is matched
178 against a commit's author name, committer name, log message, and
180 Regular expression syntax is documented in
183 Find the Nth next commit which matches the current search pattern (default: 1).
185 Searching continues until either a match is found or
191 Find the Nth previous commit which matches the current search pattern
194 Searching continues until either a match is found or
202 view with new commits found in the repository.
206 view and toggle display of merged commits.
209 option determines whether merged commits are displayed initially.
213 view listing all references in the repository.
214 This can then be used to open a new
216 view for arbitrary branches and tags.
218 Toggle between showing the author and the committer name.
226 Display individual commits which were merged into the current branch
230 shows the linear history of the current branch only.
233 key binding can be used to toggle display of merged commits at run-time.
235 Start traversing history at the specified
237 The expected argument is the name of a branch or a commit ID SHA1 hash.
238 An abbreviated hash argument will be expanded to a full SHA1 hash
239 automatically, provided the abbreviation is unique.
240 If this option is not specified, default to the work tree's current branch
241 if invoked in a work tree, or to the repository's HEAD reference.
242 .It Fl r Ar repository-path
243 Use the repository at the specified path.
244 If not specified, assume the repository is located at or above the current
246 If this directory is a
248 work tree, use the repository path associated with this work tree.
250 .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
251 Display the differences between two objects in the repository.
252 Treat each of the two arguments as a reference, a tag name, or an object
253 ID SHA1 hash, and display differences between the corresponding objects.
254 Both objects must be of the same type (blobs, trees, or commits).
255 An abbreviated hash argument will be expanded to a full SHA1 hash
256 automatically, provided the abbreviation is unique.
260 are as follows (N denotes optional prefixed count modifier):
263 Toggle treatment of file contents as ASCII text even if binary data was
265 .It Cm Down-arrow, j, Ctrl-n
266 Scroll down N lines (default: 1).
267 .It Cm Up-arrow, k, Ctrl-p
268 Scroll up N lines (default: 1).
269 .It Cm Right-arrow, l
270 Scroll view to the right N increments (default: 1).
272 Diff output moves left on the screen.
274 Scroll view to the left N increments (default: 1).
276 Diff output moves right on the screen.
278 Scroll view to the rightmost position.
280 Scroll view left to the start of the line.
281 .It Cm Page-down, Space, Ctrl+f, f
282 Scroll down N pages (default: 1).
283 .It Cm Page-up, Ctrl+b, b
284 Scroll up N pages (default: 1).
286 Scroll down N half pages (default: 1).
288 Scroll up N half pages (default: 1).
290 Scroll to the top of the view.
292 Scroll to the bottom of the view.
294 Reduce diff context by N lines (default: 1).
296 Increase diff context by N lines (default: 1).
300 view was opened via the
302 view, move to the Nth previous (younger) commit.
303 If the diff was opened via the
305 view, move to the Nth previous line and load the corresponding commit
310 view was opened via the
312 view, move to the Nth next (older) commit.
313 If the diff was opened via the
315 view, move to the Nth next line and load the corresponding commit (default: 1).
317 Prompt for a search pattern and start searching for matching lines.
318 The search pattern is an extended regular expression.
319 Regular expression syntax is documented in
322 Find the Nth next line which matches the current search pattern (default: 1).
324 Find the Nth previous line which matches the current search pattern
327 Toggle display of whitespace-only changes.
329 Change the diff algorithm.
330 Supported diff algorithms are Myers (quick and dirty) and
331 Patience (slow and tidy).
332 This is a global setting which also affects the
342 Treat file contents as ASCII text even if binary data is detected.
344 Set the number of context lines shown in the diff.
345 By default, 3 lines of context are shown.
346 .It Fl r Ar repository-path
347 Use the repository at the specified path.
348 If not specified, assume the repository is located at or above the current
350 If this directory is a
352 work tree, use the repository path associated with this work tree.
354 Ignore whitespace-only changes.
356 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
357 Display line-by-line history of a file at the specified path.
361 are as follows (N denotes optional prefixed count modifier):
363 .It Cm Down-arrow, j, Ctrl-n
364 Move the selection cursor down N pages (default: 1).
365 .It Cm Up-arrow, k, Ctrl-p
366 Move the selection cursor up N pages (default: 1).
367 .It Cm Right-arrow, l
368 Scroll view to the right N increments (default: 1).
370 File output moves left on the screen.
372 Scroll view to the left N increments (default: 1).
374 File output moves right on the screen.
376 Scroll view to the rightmost position.
378 Scroll view left to the start of the line.
379 .It Cm Page-down, Space, Ctrl+f, f
380 Move the selection cursor down N pages (default: 1).
381 .It Cm Page-up, Ctrl+b, b
382 Move the selection cursor up N pages (default: 1).
384 Move the selection cursor down N half pages (default: 1).
386 Move the selection cursor up N half pages (default: 1).
388 Move the selection cursor to the first line of the file.
390 Move the selection cursor to the last line of the file.
394 view for the currently selected line's commit.
398 view with the version of the file as found in the currently
399 selected line's commit.
403 view with the version of the file as found in the parent commit of the
404 currently selected line's commit.
408 view with the previously blamed commit.
410 Prompt for a search pattern and start searching for matching lines.
411 The search pattern is an extended regular expression.
412 Regular expression syntax is documented in
415 Find the Nth next line which matches the current search pattern (default: 1).
417 Find the Nth previous line which matches the current search pattern
420 Change the diff algorithm.
421 Supported diff algorithms are Myers (quick and dirty) and
422 Patience (slow and tidy).
423 This is a global setting which also affects the
433 Start traversing history at the specified
435 The expected argument is the name of a branch or a commit ID SHA1 hash.
436 An abbreviated hash argument will be expanded to a full SHA1 hash
437 automatically, provided the abbreviation is unique.
438 .It Fl r Ar repository-path
439 Use the repository at the specified path.
440 If not specified, assume the repository is located at or above the current
442 If this directory is a
444 work tree, use the repository path associated with this work tree.
446 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
447 Display the repository tree.
450 is specified, show tree entries at this path.
452 Displayed tree entries may carry one of the following trailing annotations:
453 .Bl -column YXZ description
454 .It @ Ta entry is a symbolic link
455 .It / Ta entry is a directory
456 .It * Ta entry is an executable file
457 .It $ Ta entry is a Git submodule
460 Symbolic link entries are also annotated with the target path of the link.
464 are as follows (N denotes optional prefixed count modifier):
466 .It Cm Down-arrow, j, Ctrl-n
467 Move the selection cursor down N lines (default: 1).
468 .It Cm Up-arrow, k, Ctrl-p
469 Move the selection cursor up N lines (default: 1).
470 .It Cm Page-down, Space, Ctrl+f, f
471 Move the selection cursor down N pages (default: 1).
472 .It Cm Page-up, Ctrl+b, b
473 Move the selection cursor up N pages (default: 1).
475 Move the selection cursor down N half pages (default: 1).
477 Move the selection cursor up N half pages (default: 1).
479 Move the selection cursor to the first entry.
481 Move the selection cursor to the last entry.
483 Enter the currently selected directory, or switch to the
485 view for the currently selected file.
489 view for the currently selected tree entry.
493 view listing all references in the repository.
494 This can then be used to open a new
496 view for arbitrary branches and tags.
498 Move back to the Nth parent directory (default: 1).
500 Show object IDs for all objects displayed in the
504 Prompt for a search pattern and start searching for matching tree entries.
505 The search pattern is an extended regular expression which is matched
506 against the tree entry's name.
507 Regular expression syntax is documented in
510 Find the Nth next tree entry which matches the current search pattern
513 Find the Nth previous tree entry which matches the current search pattern
522 Start traversing history at the specified
524 The expected argument is the name of a branch or a commit ID SHA1 hash.
525 An abbreviated hash argument will be expanded to a full SHA1 hash
526 automatically, provided the abbreviation is unique.
527 .It Fl r Ar repository-path
528 Use the repository at the specified path.
529 If not specified, assume the repository is located at or above the current
531 If this directory is a
533 work tree, use the repository path associated with this work tree.
535 .It Cm ref Oo Fl r Ar repository-path Oc
536 Display references in the repository.
540 are as follows (N denotes optional prefixed count modifier):
542 .It Cm Down-arrow, j, Ctrl-n
543 Move the selection cursor down N lines (default: 1).
544 .It Cm Up-arrow, k, Ctrl-p
545 Move the selection cursor up N lines (default: 1).
546 .It Cm Page-down, Space, Ctrl+f, f
547 Move the selection cursor down N pages (default: 1).
548 .It Cm Page-up, Ctrl+b, b
549 Move the selection cursor up N pages (default: 1).
551 Move the selection cursor down N half pages (default: 1).
553 Move the selection cursor up N half pages (default: 1).
555 Move the selection cursor to the first reference.
557 Move the selection cursor to the last reference.
561 view which begins traversing history at the commit resolved via the
562 currently selected reference.
566 view showing the tree resolved via the currently selected reference.
568 Show object IDs for all non-symbolic references displayed in the
572 Show last modified date of each displayed reference.
574 Toggle display order of references between sort by name and sort by timestamp.
576 Prompt for a search pattern and start searching for matching references.
577 The search pattern is an extended regular expression which is matched
578 against absolute reference names.
579 Regular expression syntax is documented in
582 Find the Nth next reference which matches the current search pattern
585 Find the Nth previous reference which matches the current search pattern
588 Reload the list of references displayed by the
597 .It Fl r Ar repository-path
598 Use the repository at the specified path.
599 If not specified, assume the repository is located at or above the current
601 If this directory is a
603 work tree, use the repository path associated with this work tree.
607 .Bl -tag -width TOG_VIEW_SPLIT_MODE
608 .It Ev TOG_DIFF_ALGORITHM
609 Determines the default diff algorithm used by
611 Supported diff algorithms are Myers (quick and dirty) and
612 Patience (slow and tidy).
614 .Ev TOG_DIFF_ALGORITHM
619 If unset, the Myers diff algorithm will be used by default.
620 .It Ev TOG_VIEW_SPLIT_MODE
621 Determines the default layout of split-screen views.
627 will use horizontal split by default.
628 Otherwise, vertical split will be used.
631 key can be used to switch between vertical and horizontal split layout
635 shows colorized output if this variable is set to a non-empty value.
636 The default color scheme can be modified by setting the environment
637 variables documented below.
638 The colors available in color schemes are
648 which maps to the terminal's default foreground color.
649 .It Ev TOG_COLOR_DIFF_MINUS
650 The color used to mark up removed lines in diffs.
651 If not set, the default value
654 .It Ev TOG_COLOR_DIFF_PLUS
655 The color used to mark up added lines in diffs.
656 If not set, the default value
659 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
660 The color used to mark up chunk header lines in diffs.
661 If not set, the default value
664 .It Ev TOG_COLOR_DIFF_META
665 The color used to mark up meta data in diffs.
666 If not set, the default value
669 .It Ev TOG_COLOR_TREE_SUBMODULE
670 The color used to mark up submodule tree entries.
671 If not set, the default value
674 .It Ev TOG_COLOR_TREE_SYMLINK
675 The color used to mark up symbolic link tree entries.
676 If not set, the default value
679 .It Ev TOG_COLOR_TREE_DIRECTORY
680 The color used to mark up directory tree entries.
681 If not set, the default value
684 .It Ev TOG_COLOR_TREE_EXECUTABLE
685 The color used to mark up executable file tree entries.
686 If not set, the default value
689 .It Ev TOG_COLOR_COMMIT
690 The color used to mark up commit IDs.
691 If not set, the default value
694 .It Ev TOG_COLOR_AUTHOR
695 The color used to mark up author information.
696 If not set, the default value
699 .It Ev TOG_COLOR_DATE
700 The color used to mark up date information.
701 If not set, the default value
704 .It Ev TOG_COLOR_REFS_HEADS
705 The color used to mark up references in the
708 If not set, the default value
711 .It Ev TOG_COLOR_REFS_TAGS
712 The color used to mark up references in the
715 If not set, the default value
718 .It Ev TOG_COLOR_REFS_REMOTES
719 The color used to mark up references in the
722 If not set, the default value
725 .It Ev TOG_COLOR_REFS_BACKUP
726 The color used to mark up references in the
729 If not set, the default value
737 .Xr git-repository 5 ,
740 .An Christian Weisgerber Aq Mt naddy@openbsd.org
741 .An Josh Rickmar Aq Mt jrick@zettaport.com
742 .An Joshua Stein Aq Mt jcs@openbsd.org
743 .An Mark Jamsek Aq Mt mark@jamsek.dev
744 .An Martin Pieuchot Aq Mt mpi@openbsd.org
745 .An Omar Polo Aq Mt op@openbsd.org
746 .An Stefan Sperling Aq Mt stsp@openbsd.org
747 .An Klemens Nanni Aq Mt kn@openbsd.org