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
118 .Op Fl r Ar repository-path
121 Display history of a repository.
124 is specified, show only commits which modified this path.
125 If invoked in a work tree, the
127 is interpreted relative to the current working directory,
128 and the work tree's path prefix is implicitly prepended.
129 Otherwise, the path is interpreted relative to the repository root.
131 This command is also executed if no explicit command is specified.
135 are as follows (N denotes optional prefixed count modifier):
137 .It Cm Down-arrow, j, >, Full stop, Ctrl-n
138 Move the selection cursor down N lines (default: 1).
139 .It Cm Up-arrow, k, <, Comma, Ctrl-p
140 Move the selection cursor up N lines (default: 1).
141 .It Cm Right-arrow, l
142 Scroll log message field to the right N increments (default: 1).
144 Log message moves left on the screen.
146 Scroll log message field to the left N increments (default: 1).
148 Log message moves right on the screen.
150 Scroll log message field to the rightmost position.
152 Scroll log message field to the leftmost position.
153 .It Cm Page-down, Space, Ctrl+f, f
154 Move the selection cursor down N pages (default: 1).
155 .It Cm Page-up, Ctrl+b, b
156 Move the selection cursor up N pages (default: 1).
158 Move the selection cursor down N half pages (default: 1).
160 Move the selection cursor up N half pages (default: 1).
162 Move the cursor to the newest commit.
164 Move the cursor to the oldest commit.
165 This will traverse all commits on the current branch which may take
166 a long time depending on the number of commits in branch history.
167 If needed, this operation can be cancelled with
174 view showing file changes made in the currently selected commit.
178 view showing the tree for the currently selected commit.
180 Show log entries for the parent directory of the currently selected path.
181 However when an active search is in progress or when additional commits
184 aborts the running operation.
186 Prompt for a search pattern and start searching for matching commits.
187 The search pattern is an extended regular expression which is matched
188 against a commit's author name, committer name, log message, and
190 Regular expression syntax is documented in
195 but hides the non-matching commits.
196 Use the empty string as a pattern to display all commits.
198 Find the Nth next commit which matches the current search pattern (default: 1).
200 Searching continues until either a match is found or
206 Find the Nth previous commit which matches the current search pattern
209 Searching continues until either a match is found or
217 view with new commits found in the repository.
221 view and toggle display of merged commits.
224 option determines whether merged commits are displayed initially.
228 view listing all references in the repository.
229 This can then be used to open a new
231 view for arbitrary branches and tags.
233 Toggle between showing the author and the committer name.
241 Display individual commits which were merged into the current branch
245 shows the linear history of the current branch only.
248 key binding can be used to toggle display of merged commits at run-time.
250 Start traversing history at the specified
252 The expected argument is the name of a branch or a commit ID SHA1 hash.
253 An abbreviated hash argument will be expanded to a full SHA1 hash
254 automatically, provided the abbreviation is unique.
255 If this option is not specified, default to the work tree's current branch
256 if invoked in a work tree, or to the repository's HEAD reference.
257 .It Fl r Ar repository-path
258 Use the repository at the specified path.
259 If not specified, assume the repository is located at or above the current
261 If this directory is a
263 work tree, use the repository path associated with this work tree.
269 .Op Fl r Ar repository-path
273 Display the differences between two objects in the repository.
274 Treat each of the two arguments as a reference, a tag name, or an object
275 ID SHA1 hash, and display differences between the corresponding objects.
276 Both objects must be of the same type (blobs, trees, or commits).
277 An abbreviated hash argument will be expanded to a full SHA1 hash
278 automatically, provided the abbreviation is unique.
282 are as follows (N denotes optional prefixed count modifier):
285 Toggle treatment of file contents as ASCII text even if binary data was
287 .It Cm Down-arrow, j, Ctrl-n
288 Scroll down N lines (default: 1).
289 .It Cm Up-arrow, k, Ctrl-p
290 Scroll up N lines (default: 1).
291 .It Cm Right-arrow, l
292 Scroll view to the right N increments (default: 1).
294 Diff output moves left on the screen.
296 Scroll view to the left N increments (default: 1).
298 Diff output moves right on the screen.
300 Scroll view to the rightmost position.
302 Scroll view left to the start of the line.
303 .It Cm Page-down, Space, Ctrl+f, f
304 Scroll down N pages (default: 1).
305 .It Cm Page-up, Ctrl+b, b
306 Scroll up N pages (default: 1).
308 Scroll down N half pages (default: 1).
310 Scroll up N half pages (default: 1).
312 Scroll to the top of the view.
314 Scroll to the bottom of the view.
316 Navigate to the Nth previous file in the diff (default: 1).
318 Navigate to the Nth next file in the diff (default: 1).
320 Navigate to the Nth previous hunk in the diff (default: 1).
322 Navigate to the Nth next hunk in the diff (default: 1).
324 Reduce diff context by N lines (default: 1).
326 Increase diff context by N lines (default: 1).
330 view was opened via the
332 view, move to the Nth previous (younger) commit.
333 If the diff was opened via the
335 view, move to the Nth previous line and load the corresponding commit
337 .It Cm >, Full stop, J
340 view was opened via the
342 view, move to the Nth next (older) commit.
343 If the diff was opened via the
345 view, move to the Nth next line and load the corresponding commit (default: 1).
347 Prompt for a search pattern and start searching for matching lines.
348 The search pattern is an extended regular expression.
349 Regular expression syntax is documented in
352 Find the Nth next line which matches the current search pattern (default: 1).
354 Find the Nth previous line which matches the current search pattern
357 Toggle display of whitespace-only changes.
359 Change the diff algorithm.
360 Supported diff algorithms are Myers (quick and dirty) and
361 Patience (slow and tidy).
362 This is a global setting which also affects the
372 Treat file contents as ASCII text even if binary data is detected.
374 Set the number of context lines shown in the diff.
375 By default, 3 lines of context are shown.
376 .It Fl r Ar repository-path
377 Use the repository at the specified path.
378 If not specified, assume the repository is located at or above the current
380 If this directory is a
382 work tree, use the repository path associated with this work tree.
384 Ignore whitespace-only changes.
389 .Op Fl r Ar repository-path
392 Display line-by-line history of a file at the specified path.
396 are as follows (N denotes optional prefixed count modifier):
398 .It Cm Down-arrow, j, Ctrl-n
399 Move the selection cursor down N pages (default: 1).
400 .It Cm Up-arrow, k, Ctrl-p
401 Move the selection cursor up N pages (default: 1).
402 .It Cm Right-arrow, l
403 Scroll view to the right N increments (default: 1).
405 File output moves left on the screen.
407 Scroll view to the left N increments (default: 1).
409 File output moves right on the screen.
411 Scroll view to the rightmost position.
413 Scroll view left to the start of the line.
414 .It Cm Page-down, Space, Ctrl+f, f
415 Move the selection cursor down N pages (default: 1).
416 .It Cm Page-up, Ctrl+b, b
417 Move the selection cursor up N pages (default: 1).
419 Move the selection cursor down N half pages (default: 1).
421 Move the selection cursor up N half pages (default: 1).
423 Move the selection cursor to the first line of the file.
425 Move the selection cursor to the last line of the file.
429 view for the currently selected line's commit.
433 view with the version of the file as found in the currently
434 selected line's commit.
438 view with the version of the file as found in the parent commit of the
439 currently selected line's commit.
443 view with the previously blamed commit.
447 view for the currently selected annotated line.
449 Prompt for a search pattern and start searching for matching lines.
450 The search pattern is an extended regular expression.
451 Regular expression syntax is documented in
454 Find the Nth next line which matches the current search pattern (default: 1).
456 Find the Nth previous line which matches the current search pattern
459 Change the diff algorithm.
460 Supported diff algorithms are Myers (quick and dirty) and
461 Patience (slow and tidy).
462 This is a global setting which also affects the
472 Start traversing history at the specified
474 The expected argument is the name of a branch or a commit ID SHA1 hash.
475 An abbreviated hash argument will be expanded to a full SHA1 hash
476 automatically, provided the abbreviation is unique.
477 .It Fl r Ar repository-path
478 Use the repository at the specified path.
479 If not specified, assume the repository is located at or above the current
481 If this directory is a
483 work tree, use the repository path associated with this work tree.
488 .Op Fl r Ar repository-path
491 Display the repository tree.
494 is specified, show tree entries at this path.
496 Displayed tree entries may carry one of the following trailing annotations:
497 .Bl -column YXZ description
498 .It @ Ta entry is a symbolic link
499 .It / Ta entry is a directory
500 .It * Ta entry is an executable file
501 .It $ Ta entry is a Git submodule
504 Symbolic link entries are also annotated with the target path of the link.
508 are as follows (N denotes optional prefixed count modifier):
510 .It Cm Down-arrow, j, Ctrl-n
511 Move the selection cursor down N lines (default: 1).
512 .It Cm Up-arrow, k, Ctrl-p
513 Move the selection cursor up N lines (default: 1).
514 .It Cm Page-down, Space, Ctrl+f, f
515 Move the selection cursor down N pages (default: 1).
516 .It Cm Page-up, Ctrl+b, b
517 Move the selection cursor up N pages (default: 1).
519 Move the selection cursor down N half pages (default: 1).
521 Move the selection cursor up N half pages (default: 1).
523 Move the selection cursor to the first entry.
525 Move the selection cursor to the last entry.
527 Enter the currently selected directory, or switch to the
529 view for the currently selected file.
533 view for the currently selected tree entry.
537 view listing all references in the repository.
538 This can then be used to open a new
540 view for arbitrary branches and tags.
542 Move back to the Nth parent directory (default: 1).
544 Show object IDs for all objects displayed in the
548 Prompt for a search pattern and start searching for matching tree entries.
549 The search pattern is an extended regular expression which is matched
550 against the tree entry's name.
551 Regular expression syntax is documented in
554 Find the Nth next tree entry which matches the current search pattern
557 Find the Nth previous tree entry which matches the current search pattern
566 Start traversing history at the specified
568 The expected argument is the name of a branch or a commit ID SHA1 hash.
569 An abbreviated hash argument will be expanded to a full SHA1 hash
570 automatically, provided the abbreviation is unique.
571 .It Fl r Ar repository-path
572 Use the repository at the specified path.
573 If not specified, assume the repository is located at or above the current
575 If this directory is a
577 work tree, use the repository path associated with this work tree.
579 .It Cm ref Op Fl r Ar repository-path
580 Display references in the repository.
584 are as follows (N denotes optional prefixed count modifier):
586 .It Cm Down-arrow, j, Ctrl-n
587 Move the selection cursor down N lines (default: 1).
588 .It Cm Up-arrow, k, Ctrl-p
589 Move the selection cursor up N lines (default: 1).
590 .It Cm Page-down, Space, Ctrl+f, f
591 Move the selection cursor down N pages (default: 1).
592 .It Cm Page-up, Ctrl+b, b
593 Move the selection cursor up N pages (default: 1).
595 Move the selection cursor down N half pages (default: 1).
597 Move the selection cursor up N half pages (default: 1).
599 Move the selection cursor to the first reference.
601 Move the selection cursor to the last reference.
605 view which begins traversing history at the commit resolved via the
606 currently selected reference.
610 view showing the tree resolved via the currently selected reference.
612 Show object IDs for all non-symbolic references displayed in the
616 Show last modified date of each displayed reference.
618 Toggle display order of references between sort by name and sort by timestamp.
620 Prompt for a search pattern and start searching for matching references.
621 The search pattern is an extended regular expression which is matched
622 against absolute reference names.
623 Regular expression syntax is documented in
626 Find the Nth next reference which matches the current search pattern
629 Find the Nth previous reference which matches the current search pattern
632 Reload the list of references displayed by the
641 .It Fl r Ar repository-path
642 Use the repository at the specified path.
643 If not specified, assume the repository is located at or above the current
645 If this directory is a
647 work tree, use the repository path associated with this work tree.
651 .Bl -tag -width TOG_VIEW_SPLIT_MODE
652 .It Ev TOG_DIFF_ALGORITHM
653 Determines the default diff algorithm used by
655 Supported diff algorithms are Myers (quick and dirty) and
656 Patience (slow and tidy).
658 .Ev TOG_DIFF_ALGORITHM
663 If unset, the Myers diff algorithm will be used by default.
664 .It Ev TOG_VIEW_SPLIT_MODE
665 Determines the default layout of split-screen views.
671 will use horizontal split by default.
672 Otherwise, vertical split will be used.
675 key can be used to switch between vertical and horizontal split layout
679 shows colorized output if this variable is set to a non-empty value.
680 The default color scheme can be modified by setting the environment
681 variables documented below.
682 The colors available in color schemes are
692 which maps to the terminal's default foreground color.
693 .It Ev TOG_COLOR_DIFF_MINUS
694 The color used to mark up removed lines in diffs.
695 If not set, the default value
698 .It Ev TOG_COLOR_DIFF_PLUS
699 The color used to mark up added lines in diffs.
700 If not set, the default value
703 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
704 The color used to mark up chunk header lines in diffs.
705 If not set, the default value
708 .It Ev TOG_COLOR_DIFF_META
709 The color used to mark up meta data in diffs.
710 If not set, the default value
713 .It Ev TOG_COLOR_TREE_SUBMODULE
714 The color used to mark up submodule tree entries.
715 If not set, the default value
718 .It Ev TOG_COLOR_TREE_SYMLINK
719 The color used to mark up symbolic link tree entries.
720 If not set, the default value
723 .It Ev TOG_COLOR_TREE_DIRECTORY
724 The color used to mark up directory tree entries.
725 If not set, the default value
728 .It Ev TOG_COLOR_TREE_EXECUTABLE
729 The color used to mark up executable file tree entries.
730 If not set, the default value
733 .It Ev TOG_COLOR_COMMIT
734 The color used to mark up commit IDs.
735 If not set, the default value
738 .It Ev TOG_COLOR_AUTHOR
739 The color used to mark up author information.
740 If not set, the default value
743 .It Ev TOG_COLOR_DATE
744 The color used to mark up date information.
745 If not set, the default value
748 .It Ev TOG_COLOR_REFS_HEADS
749 The color used to mark up references in the
752 If not set, the default value
755 .It Ev TOG_COLOR_REFS_TAGS
756 The color used to mark up references in the
759 If not set, the default value
762 .It Ev TOG_COLOR_REFS_REMOTES
763 The color used to mark up references in the
766 If not set, the default value
769 .It Ev TOG_COLOR_REFS_BACKUP
770 The color used to mark up references in the
773 If not set, the default value
781 .Xr git-repository 5 ,
784 .An Christian Weisgerber Aq Mt naddy@openbsd.org
785 .An Josh Rickmar Aq Mt jrick@zettaport.com
786 .An Joshua Stein Aq Mt jcs@openbsd.org
787 .An Mark Jamsek Aq Mt mark@jamsek.dev
788 .An Martin Pieuchot Aq Mt mpi@openbsd.org
789 .An Omar Polo Aq Mt op@openbsd.org
790 .An Stefan Sperling Aq Mt stsp@openbsd.org
791 .An Klemens Nanni Aq Mt kn@openbsd.org