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).
97 Go to line N in the view (default: last line).
99 Go to line N in the view (default: first line).
102 Global options must precede the command name, and are as follows:
103 .Bl -tag -width tenletters
105 Display usage information.
107 Display program version and exit immediately.
113 .Bl -tag -width blame
114 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
115 Display history of a repository.
118 is specified, show only commits which modified this path.
119 If invoked in a work tree, the
121 is interpreted relative to the current working directory,
122 and the work tree's path prefix is implicitly prepended.
123 Otherwise, the path is interpreted relative to the repository root.
125 This command is also executed if no explicit command is specified.
129 are as follows (N denotes optional prefixed count modifier):
131 .It Cm Down-arrow, j, >, Full stop, Ctrl-n
132 Move the selection cursor down N lines (default: 1).
133 .It Cm Up-arrow, k, <, Comma, Ctrl-p
134 Move the selection cursor up N lines (default: 1).
135 .It Cm Right-arrow, l
136 Scroll log message field to the right N increments (default: 1).
138 Log message moves left on the screen.
140 Scroll log message field to the left N increments (default: 1).
142 Log message moves right on the screen.
144 Scroll log message field to the rightmost position.
146 Scroll log message field to the leftmost position.
147 .It Cm Page-down, Space, Ctrl+f, f
148 Move the selection cursor down N pages (default: 1).
149 .It Cm Page-up, Ctrl+b, b
150 Move the selection cursor up N pages (default: 1).
152 Move the selection cursor down N half pages (default: 1).
154 Move the selection cursor up N half pages (default: 1).
156 Move the cursor to the newest commit.
158 Move the cursor to the oldest commit.
159 This will traverse all commits on the current branch which may take
160 a long time depending on the number of commits in branch history.
161 If needed, this operation can be cancelled with
168 view showing file changes made in the currently selected commit.
172 view showing the tree for the currently selected commit.
174 Show log entries for the parent directory of the currently selected path.
175 However when an active search is in progress or when additional commits
178 aborts the running operation.
180 Prompt for a search pattern and start searching for matching commits.
181 The search pattern is an extended regular expression which is matched
182 against a commit's author name, committer name, log message, and
184 Regular expression syntax is documented in
187 Find the Nth next commit which matches the current search pattern (default: 1).
189 Searching continues until either a match is found or
195 Find the Nth previous commit which matches the current search pattern
198 Searching continues until either a match is found or
206 view with new commits found in the repository.
210 view and toggle display of merged commits.
213 option determines whether merged commits are displayed initially.
217 view listing all references in the repository.
218 This can then be used to open a new
220 view for arbitrary branches and tags.
222 Toggle between showing the author and the committer name.
230 Display individual commits which were merged into the current branch
234 shows the linear history of the current branch only.
237 key binding can be used to toggle display of merged commits at run-time.
239 Start traversing history at the specified
241 The expected argument is the name of a branch or a commit ID SHA1 hash.
242 An abbreviated hash argument will be expanded to a full SHA1 hash
243 automatically, provided the abbreviation is unique.
244 If this option is not specified, default to the work tree's current branch
245 if invoked in a work tree, or to the repository's HEAD reference.
246 .It Fl r Ar repository-path
247 Use the repository at the specified path.
248 If not specified, assume the repository is located at or above the current
250 If this directory is a
252 work tree, use the repository path associated with this work tree.
254 .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
255 Display the differences between two objects in the repository.
256 Treat each of the two arguments as a reference, a tag name, or an object
257 ID SHA1 hash, and display differences between the corresponding objects.
258 Both objects must be of the same type (blobs, trees, or commits).
259 An abbreviated hash argument will be expanded to a full SHA1 hash
260 automatically, provided the abbreviation is unique.
264 are as follows (N denotes optional prefixed count modifier):
267 Toggle treatment of file contents as ASCII text even if binary data was
269 .It Cm Down-arrow, j, Ctrl-n
270 Scroll down N lines (default: 1).
271 .It Cm Up-arrow, k, Ctrl-p
272 Scroll up N lines (default: 1).
273 .It Cm Right-arrow, l
274 Scroll view to the right N increments (default: 1).
276 Diff output moves left on the screen.
278 Scroll view to the left N increments (default: 1).
280 Diff output moves right on the screen.
282 Scroll view to the rightmost position.
284 Scroll view left to the start of the line.
285 .It Cm Page-down, Space, Ctrl+f, f
286 Scroll down N pages (default: 1).
287 .It Cm Page-up, Ctrl+b, b
288 Scroll up N pages (default: 1).
290 Scroll down N half pages (default: 1).
292 Scroll up N half pages (default: 1).
294 Scroll to the top of the view.
296 Scroll to the bottom of the view.
298 Reduce diff context by N lines (default: 1).
300 Increase diff context by N lines (default: 1).
304 view was opened via the
306 view, move to the Nth previous (younger) commit.
307 If the diff was opened via the
309 view, move to the Nth previous line and load the corresponding commit
311 .It Cm >, Full stop, J
314 view was opened via the
316 view, move to the Nth next (older) commit.
317 If the diff was opened via the
319 view, move to the Nth next line and load the corresponding commit (default: 1).
321 Prompt for a search pattern and start searching for matching lines.
322 The search pattern is an extended regular expression.
323 Regular expression syntax is documented in
326 Find the Nth next line which matches the current search pattern (default: 1).
328 Find the Nth previous line which matches the current search pattern
331 Toggle display of whitespace-only changes.
333 Change the diff algorithm.
334 Supported diff algorithms are Myers (quick and dirty) and
335 Patience (slow and tidy).
336 This is a global setting which also affects the
346 Treat file contents as ASCII text even if binary data is detected.
348 Set the number of context lines shown in the diff.
349 By default, 3 lines of context are shown.
350 .It Fl r Ar repository-path
351 Use the repository at the specified path.
352 If not specified, assume the repository is located at or above the current
354 If this directory is a
356 work tree, use the repository path associated with this work tree.
358 Ignore whitespace-only changes.
360 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
361 Display line-by-line history of a file at the specified path.
365 are as follows (N denotes optional prefixed count modifier):
367 .It Cm Down-arrow, j, Ctrl-n
368 Move the selection cursor down N pages (default: 1).
369 .It Cm Up-arrow, k, Ctrl-p
370 Move the selection cursor up N pages (default: 1).
371 .It Cm Right-arrow, l
372 Scroll view to the right N increments (default: 1).
374 File output moves left on the screen.
376 Scroll view to the left N increments (default: 1).
378 File output moves right on the screen.
380 Scroll view to the rightmost position.
382 Scroll view left to the start of the line.
383 .It Cm Page-down, Space, Ctrl+f, f
384 Move the selection cursor down N pages (default: 1).
385 .It Cm Page-up, Ctrl+b, b
386 Move the selection cursor up N pages (default: 1).
388 Move the selection cursor down N half pages (default: 1).
390 Move the selection cursor up N half pages (default: 1).
392 Move the selection cursor to the first line of the file.
394 Move the selection cursor to the last line of the file.
398 view for the currently selected line's commit.
402 view with the version of the file as found in the currently
403 selected line's commit.
407 view with the version of the file as found in the parent commit of the
408 currently selected line's commit.
412 view with the previously blamed commit.
416 view for the currently selected annotated line.
418 Prompt for a search pattern and start searching for matching lines.
419 The search pattern is an extended regular expression.
420 Regular expression syntax is documented in
423 Find the Nth next line which matches the current search pattern (default: 1).
425 Find the Nth previous line which matches the current search pattern
428 Change the diff algorithm.
429 Supported diff algorithms are Myers (quick and dirty) and
430 Patience (slow and tidy).
431 This is a global setting which also affects the
441 Start traversing history at the specified
443 The expected argument is the name of a branch or a commit ID SHA1 hash.
444 An abbreviated hash argument will be expanded to a full SHA1 hash
445 automatically, provided the abbreviation is unique.
446 .It Fl r Ar repository-path
447 Use the repository at the specified path.
448 If not specified, assume the repository is located at or above the current
450 If this directory is a
452 work tree, use the repository path associated with this work tree.
454 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
455 Display the repository tree.
458 is specified, show tree entries at this path.
460 Displayed tree entries may carry one of the following trailing annotations:
461 .Bl -column YXZ description
462 .It @ Ta entry is a symbolic link
463 .It / Ta entry is a directory
464 .It * Ta entry is an executable file
465 .It $ Ta entry is a Git submodule
468 Symbolic link entries are also annotated with the target path of the link.
472 are as follows (N denotes optional prefixed count modifier):
474 .It Cm Down-arrow, j, Ctrl-n
475 Move the selection cursor down N lines (default: 1).
476 .It Cm Up-arrow, k, Ctrl-p
477 Move the selection cursor up N lines (default: 1).
478 .It Cm Page-down, Space, Ctrl+f, f
479 Move the selection cursor down N pages (default: 1).
480 .It Cm Page-up, Ctrl+b, b
481 Move the selection cursor up N pages (default: 1).
483 Move the selection cursor down N half pages (default: 1).
485 Move the selection cursor up N half pages (default: 1).
487 Move the selection cursor to the first entry.
489 Move the selection cursor to the last entry.
491 Enter the currently selected directory, or switch to the
493 view for the currently selected file.
497 view for the currently selected tree entry.
501 view listing all references in the repository.
502 This can then be used to open a new
504 view for arbitrary branches and tags.
506 Move back to the Nth parent directory (default: 1).
508 Show object IDs for all objects displayed in the
512 Prompt for a search pattern and start searching for matching tree entries.
513 The search pattern is an extended regular expression which is matched
514 against the tree entry's name.
515 Regular expression syntax is documented in
518 Find the Nth next tree entry which matches the current search pattern
521 Find the Nth previous tree entry which matches the current search pattern
530 Start traversing history at the specified
532 The expected argument is the name of a branch or a commit ID SHA1 hash.
533 An abbreviated hash argument will be expanded to a full SHA1 hash
534 automatically, provided the abbreviation is unique.
535 .It Fl r Ar repository-path
536 Use the repository at the specified path.
537 If not specified, assume the repository is located at or above the current
539 If this directory is a
541 work tree, use the repository path associated with this work tree.
543 .It Cm ref Oo Fl r Ar repository-path Oc
544 Display references in the repository.
548 are as follows (N denotes optional prefixed count modifier):
550 .It Cm Down-arrow, j, Ctrl-n
551 Move the selection cursor down N lines (default: 1).
552 .It Cm Up-arrow, k, Ctrl-p
553 Move the selection cursor up N lines (default: 1).
554 .It Cm Page-down, Space, Ctrl+f, f
555 Move the selection cursor down N pages (default: 1).
556 .It Cm Page-up, Ctrl+b, b
557 Move the selection cursor up N pages (default: 1).
559 Move the selection cursor down N half pages (default: 1).
561 Move the selection cursor up N half pages (default: 1).
563 Move the selection cursor to the first reference.
565 Move the selection cursor to the last reference.
569 view which begins traversing history at the commit resolved via the
570 currently selected reference.
574 view showing the tree resolved via the currently selected reference.
576 Show object IDs for all non-symbolic references displayed in the
580 Show last modified date of each displayed reference.
582 Toggle display order of references between sort by name and sort by timestamp.
584 Prompt for a search pattern and start searching for matching references.
585 The search pattern is an extended regular expression which is matched
586 against absolute reference names.
587 Regular expression syntax is documented in
590 Find the Nth next reference which matches the current search pattern
593 Find the Nth previous reference which matches the current search pattern
596 Reload the list of references displayed by the
605 .It Fl r Ar repository-path
606 Use the repository at the specified path.
607 If not specified, assume the repository is located at or above the current
609 If this directory is a
611 work tree, use the repository path associated with this work tree.
615 .Bl -tag -width TOG_VIEW_SPLIT_MODE
616 .It Ev TOG_DIFF_ALGORITHM
617 Determines the default diff algorithm used by
619 Supported diff algorithms are Myers (quick and dirty) and
620 Patience (slow and tidy).
622 .Ev TOG_DIFF_ALGORITHM
627 If unset, the Myers diff algorithm will be used by default.
628 .It Ev TOG_VIEW_SPLIT_MODE
629 Determines the default layout of split-screen views.
635 will use horizontal split by default.
636 Otherwise, vertical split will be used.
639 key can be used to switch between vertical and horizontal split layout
643 shows colorized output if this variable is set to a non-empty value.
644 The default color scheme can be modified by setting the environment
645 variables documented below.
646 The colors available in color schemes are
656 which maps to the terminal's default foreground color.
657 .It Ev TOG_COLOR_DIFF_MINUS
658 The color used to mark up removed lines in diffs.
659 If not set, the default value
662 .It Ev TOG_COLOR_DIFF_PLUS
663 The color used to mark up added lines in diffs.
664 If not set, the default value
667 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
668 The color used to mark up chunk header lines in diffs.
669 If not set, the default value
672 .It Ev TOG_COLOR_DIFF_META
673 The color used to mark up meta data in diffs.
674 If not set, the default value
677 .It Ev TOG_COLOR_TREE_SUBMODULE
678 The color used to mark up submodule tree entries.
679 If not set, the default value
682 .It Ev TOG_COLOR_TREE_SYMLINK
683 The color used to mark up symbolic link tree entries.
684 If not set, the default value
687 .It Ev TOG_COLOR_TREE_DIRECTORY
688 The color used to mark up directory tree entries.
689 If not set, the default value
692 .It Ev TOG_COLOR_TREE_EXECUTABLE
693 The color used to mark up executable file tree entries.
694 If not set, the default value
697 .It Ev TOG_COLOR_COMMIT
698 The color used to mark up commit IDs.
699 If not set, the default value
702 .It Ev TOG_COLOR_AUTHOR
703 The color used to mark up author information.
704 If not set, the default value
707 .It Ev TOG_COLOR_DATE
708 The color used to mark up date information.
709 If not set, the default value
712 .It Ev TOG_COLOR_REFS_HEADS
713 The color used to mark up references in the
716 If not set, the default value
719 .It Ev TOG_COLOR_REFS_TAGS
720 The color used to mark up references in the
723 If not set, the default value
726 .It Ev TOG_COLOR_REFS_REMOTES
727 The color used to mark up references in the
730 If not set, the default value
733 .It Ev TOG_COLOR_REFS_BACKUP
734 The color used to mark up references in the
737 If not set, the default value
745 .Xr git-repository 5 ,
748 .An Christian Weisgerber Aq Mt naddy@openbsd.org
749 .An Josh Rickmar Aq Mt jrick@zettaport.com
750 .An Joshua Stein Aq Mt jcs@openbsd.org
751 .An Mark Jamsek Aq Mt mark@jamsek.dev
752 .An Martin Pieuchot Aq Mt mpi@openbsd.org
753 .An Omar Polo Aq Mt op@openbsd.org
754 .An Stefan Sperling Aq Mt stsp@openbsd.org
755 .An Klemens Nanni Aq Mt kn@openbsd.org