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
69 The global key bindings are:
75 Quit the view which is in focus.
77 Switch focus between views.
79 Toggle fullscreen mode for a split-screen view.
81 will automatically use split-screen views if the size of the terminal
82 window is sufficiently large.
84 Switch the current split mode.
86 will also render the view in the new split mode.
87 If the terminal is not wide enough when switching to a vertical split, the
88 view will render in fullscreen.
90 When in a split-screen view, decrease the size of the focussed split
91 N increments (default: 1).
93 When in a split-screen view, increase the size of the focussed split
94 N increments (default: 1).
97 Global options must precede the command name, and are as follows:
98 .Bl -tag -width tenletters
100 Display usage information.
102 Display program version and exit immediately.
108 .Bl -tag -width blame
109 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
110 Display history of a repository.
113 is specified, show only commits which modified this path.
114 If invoked in a work tree, the
116 is interpreted relative to the current working directory,
117 and the work tree's path prefix is implicitly prepended.
118 Otherwise, the path is interpreted relative to the repository root.
120 This command is also executed if no explicit command is specified.
124 are as follows (N denotes optional prefixed count modifier):
126 .It Cm Down-arrow, j, >, Full stop, Ctrl-n
127 Move the selection cursor down N lines (default: 1).
128 .It Cm Up-arrow, k, <, Comma, Ctrl-p
129 Move the selection cursor up N lines (default: 1).
130 .It Cm Right-arrow, l
131 Scroll log message field to the right N increments (default: 1).
133 Log message moves left on the screen.
135 Scroll log message field to the left N increments (default: 1).
137 Log message moves right on the screen.
139 Scroll log message field to the rightmost position.
141 Scroll log message field to the leftmost position.
142 .It Cm Page-down, Space, Ctrl+f, f
143 Move the selection cursor down N pages (default: 1).
144 .It Cm Page-up, Ctrl+b, b
145 Move the selection cursor up N pages (default: 1).
147 Move the selection cursor down N half pages (default: 1).
149 Move the selection cursor up N half pages (default: 1).
151 Move the cursor to the newest commit.
153 Move the cursor to the oldest commit.
154 This will traverse all commits on the current branch which may take
155 a long time depending on the number of commits in branch history.
156 If needed, this operation can be cancelled with
163 view showing file changes made in the currently selected commit.
167 view showing the tree for the currently selected commit.
169 Show log entries for the parent directory of the currently selected path.
170 However when an active search is in progress or when additional commits
173 aborts the running operation.
175 Prompt for a search pattern and start searching for matching commits.
176 The search pattern is an extended regular expression which is matched
177 against a commit's author name, committer name, log message, and
179 Regular expression syntax is documented in
182 Find the Nth next commit which matches the current search pattern (default: 1).
184 Searching continues until either a match is found or
190 Find the Nth previous commit which matches the current search pattern
193 Searching continues until either a match is found or
201 view with new commits found in the repository.
205 view and toggle display of merged commits.
208 option determines whether merged commits are displayed initially.
212 view listing all references in the repository.
213 This can then be used to open a new
215 view for arbitrary branches and tags.
223 Display individual commits which were merged into the current branch
227 shows the linear history of the current branch only.
230 key binding can be used to toggle display of merged commits at run-time.
232 Start traversing history at the specified
234 The expected argument is the name of a branch or a commit ID SHA1 hash.
235 An abbreviated hash argument will be expanded to a full SHA1 hash
236 automatically, provided the abbreviation is unique.
237 If this option is not specified, default to the work tree's current branch
238 if invoked in a work tree, or to the repository's HEAD reference.
239 .It Fl r Ar repository-path
240 Use the repository at the specified path.
241 If not specified, assume the repository is located at or above the current
243 If this directory is a
245 work tree, use the repository path associated with this work tree.
247 .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
248 Display the differences between two objects in the repository.
249 Treat each of the two arguments as a reference, a tag name, or an object
250 ID SHA1 hash, and display differences between the corresponding objects.
251 Both objects must be of the same type (blobs, trees, or commits).
252 An abbreviated hash argument will be expanded to a full SHA1 hash
253 automatically, provided the abbreviation is unique.
257 are as follows (N denotes optional prefixed count modifier):
260 Toggle treatment of file contents as ASCII text even if binary data was
262 .It Cm Down-arrow, j, Ctrl-n
263 Scroll down N lines (default: 1).
264 .It Cm Up-arrow, k, Ctrl-p
265 Scroll up N lines (default: 1).
266 .It Cm Right-arrow, l
267 Scroll view to the right N increments (default: 1).
269 Diff output moves left on the screen.
271 Scroll view to the left N increments (default: 1).
273 Diff output moves right on the screen.
275 Scroll view to the rightmost position.
277 Scroll view left to the start of the line.
278 .It Cm Page-down, Space, Ctrl+f, f
279 Scroll down N pages (default: 1).
280 .It Cm Page-up, Ctrl+b, b
281 Scroll up N pages (default: 1).
283 Scroll down N half pages (default: 1).
285 Scroll up N half pages (default: 1).
287 Scroll to the top of the view.
289 Scroll to the bottom of the view.
291 Reduce diff context by N lines (default: 1).
293 Increase diff context by N lines (default: 1).
297 view was opened via the
299 view, move to the Nth previous (younger) commit.
300 If the diff was opened via the
302 view, move to the Nth previous line and load the corresponding commit
307 view was opened via the
309 view, move to the Nth next (older) commit.
310 If the diff was opened via the
312 view, move to the Nth next line and load the corresponding commit (default: 1).
314 Prompt for a search pattern and start searching for matching lines.
315 The search pattern is an extended regular expression.
316 Regular expression syntax is documented in
319 Find the Nth next line which matches the current search pattern (default: 1).
321 Find the Nth previous line which matches the current search pattern
324 Toggle display of whitespace-only changes.
326 Change the diff algorithm.
327 Supported diff algorithms are Myers (quick and dirty) and
328 Patience (slow and tidy).
329 This is a global setting which also affects the
339 Treat file contents as ASCII text even if binary data is detected.
341 Set the number of context lines shown in the diff.
342 By default, 3 lines of context are shown.
343 .It Fl r Ar repository-path
344 Use the repository at the specified path.
345 If not specified, assume the repository is located at or above the current
347 If this directory is a
349 work tree, use the repository path associated with this work tree.
351 Ignore whitespace-only changes.
353 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
354 Display line-by-line history of a file at the specified path.
358 are as follows (N denotes optional prefixed count modifier):
360 .It Cm Down-arrow, j, Ctrl-n
361 Move the selection cursor down N pages (default: 1).
362 .It Cm Up-arrow, k, Ctrl-p
363 Move the selection cursor up N pages (default: 1).
364 .It Cm Right-arrow, l
365 Scroll view to the right N increments (default: 1).
367 File output moves left on the screen.
369 Scroll view to the left N increments (default: 1).
371 File output moves right on the screen.
373 Scroll view to the rightmost position.
375 Scroll view left to the start of the line.
376 .It Cm Page-down, Space, Ctrl+f, f
377 Move the selection cursor down N pages (default: 1).
378 .It Cm Page-up, Ctrl+b, b
379 Move the selection cursor up N pages (default: 1).
381 Move the selection cursor down N half pages (default: 1).
383 Move the selection cursor up N half pages (default: 1).
385 Move the selection cursor to the first line of the file.
387 Move the selection cursor to the last line of the file.
391 view for the currently selected line's commit.
395 view with the version of the file as found in the currently
396 selected line's commit.
400 view with the version of the file as found in the parent commit of the
401 currently selected line's commit.
405 view with the previously blamed commit.
407 Prompt for a search pattern and start searching for matching lines.
408 The search pattern is an extended regular expression.
409 Regular expression syntax is documented in
412 Find the Nth next line which matches the current search pattern (default: 1).
414 Find the Nth previous line which matches the current search pattern
417 Change the diff algorithm.
418 Supported diff algorithms are Myers (quick and dirty) and
419 Patience (slow and tidy).
420 This is a global setting which also affects the
430 Start traversing history at the specified
432 The expected argument is the name of a branch or a commit ID SHA1 hash.
433 An abbreviated hash argument will be expanded to a full SHA1 hash
434 automatically, provided the abbreviation is unique.
435 .It Fl r Ar repository-path
436 Use the repository at the specified path.
437 If not specified, assume the repository is located at or above the current
439 If this directory is a
441 work tree, use the repository path associated with this work tree.
443 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
444 Display the repository tree.
447 is specified, show tree entries at this path.
449 Displayed tree entries may carry one of the following trailing annotations:
450 .Bl -column YXZ description
451 .It @ Ta entry is a symbolic link
452 .It / Ta entry is a directory
453 .It * Ta entry is an executable file
454 .It $ Ta entry is a Git submodule
457 Symbolic link entries are also annotated with the target path of the link.
461 are as follows (N denotes optional prefixed count modifier):
463 .It Cm Down-arrow, j, Ctrl-n
464 Move the selection cursor down N lines (default: 1).
465 .It Cm Up-arrow, k, Ctrl-p
466 Move the selection cursor up N lines (default: 1).
467 .It Cm Page-down, Space, Ctrl+f, f
468 Move the selection cursor down N pages (default: 1).
469 .It Cm Page-up, Ctrl+b, b
470 Move the selection cursor up N pages (default: 1).
472 Move the selection cursor down N half pages (default: 1).
474 Move the selection cursor up N half pages (default: 1).
476 Move the selection cursor to the first entry.
478 Move the selection cursor to the last entry.
480 Enter the currently selected directory, or switch to the
482 view for the currently selected file.
486 view for the currently selected tree entry.
490 view listing all references in the repository.
491 This can then be used to open a new
493 view for arbitrary branches and tags.
495 Move back to the Nth parent directory (default: 1).
497 Show object IDs for all objects displayed in the
501 Prompt for a search pattern and start searching for matching tree entries.
502 The search pattern is an extended regular expression which is matched
503 against the tree entry's name.
504 Regular expression syntax is documented in
507 Find the Nth next tree entry which matches the current search pattern
510 Find the Nth previous tree entry which matches the current search pattern
519 Start traversing history at the specified
521 The expected argument is the name of a branch or a commit ID SHA1 hash.
522 An abbreviated hash argument will be expanded to a full SHA1 hash
523 automatically, provided the abbreviation is unique.
524 .It Fl r Ar repository-path
525 Use the repository at the specified path.
526 If not specified, assume the repository is located at or above the current
528 If this directory is a
530 work tree, use the repository path associated with this work tree.
532 .It Cm ref Oo Fl r Ar repository-path Oc
533 Display references in the repository.
537 are as follows (N denotes optional prefixed count modifier):
539 .It Cm Down-arrow, j, Ctrl-n
540 Move the selection cursor down N lines (default: 1).
541 .It Cm Up-arrow, k, Ctrl-p
542 Move the selection cursor up N lines (default: 1).
543 .It Cm Page-down, Space, Ctrl+f, f
544 Move the selection cursor down N pages (default: 1).
545 .It Cm Page-up, Ctrl+b, b
546 Move the selection cursor up N pages (default: 1).
548 Move the selection cursor down N half pages (default: 1).
550 Move the selection cursor up N half pages (default: 1).
552 Move the selection cursor to the first reference.
554 Move the selection cursor to the last reference.
558 view which begins traversing history at the commit resolved via the
559 currently selected reference.
563 view showing the tree resolved via the currently selected reference.
565 Show object IDs for all non-symbolic references displayed in the
569 Show last modified date of each displayed reference.
571 Toggle display order of references between sort by name and sort by timestamp.
573 Prompt for a search pattern and start searching for matching references.
574 The search pattern is an extended regular expression which is matched
575 against absolute reference names.
576 Regular expression syntax is documented in
579 Find the Nth next reference which matches the current search pattern
582 Find the Nth previous reference which matches the current search pattern
585 Reload the list of references displayed by the
594 .It Fl r Ar repository-path
595 Use the repository at the specified path.
596 If not specified, assume the repository is located at or above the current
598 If this directory is a
600 work tree, use the repository path associated with this work tree.
604 .Bl -tag -width TOG_VIEW_SPLIT_MODE
605 .It Ev TOG_DIFF_ALGORITHM
606 Determines the default diff algorithm used by
608 Supported diff algorithms are Myers (quick and dirty) and
609 Patience (slow and tidy).
611 .Ev TOG_DIFF_ALGORITHM
616 If unset, the Myers diff algorithm will be used by default.
617 .It Ev TOG_VIEW_SPLIT_MODE
620 will use vertical or horizontal split for split-screen views.
623 then split-screen views will be split horizontally.
624 Otherwise, split-screen views will be split vertically.
625 Splits can be manipulated in-session as documented above.
628 shows colorized output if this variable is set to a non-empty value.
629 The default color scheme can be modified by setting the environment
630 variables documented below.
631 The colors available in color schemes are
641 which maps to the terminal's default foreground color.
642 .It Ev TOG_COLOR_DIFF_MINUS
643 The color used to mark up removed lines in diffs.
644 If not set, the default value
647 .It Ev TOG_COLOR_DIFF_PLUS
648 The color used to mark up added lines in diffs.
649 If not set, the default value
652 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
653 The color used to mark up chunk header lines in diffs.
654 If not set, the default value
657 .It Ev TOG_COLOR_DIFF_META
658 The color used to mark up meta data in diffs.
659 If not set, the default value
662 .It Ev TOG_COLOR_TREE_SUBMODULE
663 The color used to mark up submodule tree entries.
664 If not set, the default value
667 .It Ev TOG_COLOR_TREE_SYMLINK
668 The color used to mark up symbolic link tree entries.
669 If not set, the default value
672 .It Ev TOG_COLOR_TREE_DIRECTORY
673 The color used to mark up directory tree entries.
674 If not set, the default value
677 .It Ev TOG_COLOR_TREE_EXECUTABLE
678 The color used to mark up executable file tree entries.
679 If not set, the default value
682 .It Ev TOG_COLOR_COMMIT
683 The color used to mark up commit IDs.
684 If not set, the default value
687 .It Ev TOG_COLOR_AUTHOR
688 The color used to mark up author information.
689 If not set, the default value
692 .It Ev TOG_COLOR_DATE
693 The color used to mark up date information.
694 If not set, the default value
697 .It Ev TOG_COLOR_REFS_HEADS
698 The color used to mark up references in the
701 If not set, the default value
704 .It Ev TOG_COLOR_REFS_TAGS
705 The color used to mark up references in the
708 If not set, the default value
711 .It Ev TOG_COLOR_REFS_REMOTES
712 The color used to mark up references in the
715 If not set, the default value
718 .It Ev TOG_COLOR_REFS_BACKUP
719 The color used to mark up references in the
722 If not set, the default value
730 .Xr git-repository 5 ,
733 .An Christian Weisgerber Aq Mt naddy@openbsd.org
734 .An Josh Rickmar Aq Mt jrick@zettaport.com
735 .An Joshua Stein Aq Mt jcs@openbsd.org
736 .An Mark Jamsek Aq Mt mark@jamsek.dev
737 .An Martin Pieuchot Aq Mt mpi@openbsd.org
738 .An Omar Polo Aq Mt op@openbsd.org
739 .An Stefan Sperling Aq Mt stsp@openbsd.org
740 .An Klemens Nanni Aq Mt kn@openbsd.org