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 Navigate to the Nth previous file in the diff (default: 1).
300 Navigate to the Nth next file in the diff (default: 1).
302 Navigate to the Nth previous hunk in the diff (default: 1).
304 Navigate to the Nth next hunk in the diff (default: 1).
306 Reduce diff context by N lines (default: 1).
308 Increase diff context by N lines (default: 1).
312 view was opened via the
314 view, move to the Nth previous (younger) commit.
315 If the diff was opened via the
317 view, move to the Nth previous line and load the corresponding commit
319 .It Cm >, Full stop, J
322 view was opened via the
324 view, move to the Nth next (older) commit.
325 If the diff was opened via the
327 view, move to the Nth next line and load the corresponding commit (default: 1).
329 Prompt for a search pattern and start searching for matching lines.
330 The search pattern is an extended regular expression.
331 Regular expression syntax is documented in
334 Find the Nth next line which matches the current search pattern (default: 1).
336 Find the Nth previous line which matches the current search pattern
339 Toggle display of whitespace-only changes.
341 Change the diff algorithm.
342 Supported diff algorithms are Myers (quick and dirty) and
343 Patience (slow and tidy).
344 This is a global setting which also affects the
354 Treat file contents as ASCII text even if binary data is detected.
356 Set the number of context lines shown in the diff.
357 By default, 3 lines of context are shown.
358 .It Fl r Ar repository-path
359 Use the repository at the specified path.
360 If not specified, assume the repository is located at or above the current
362 If this directory is a
364 work tree, use the repository path associated with this work tree.
366 Ignore whitespace-only changes.
368 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
369 Display line-by-line history of a file at the specified path.
373 are as follows (N denotes optional prefixed count modifier):
375 .It Cm Down-arrow, j, Ctrl-n
376 Move the selection cursor down N pages (default: 1).
377 .It Cm Up-arrow, k, Ctrl-p
378 Move the selection cursor up N pages (default: 1).
379 .It Cm Right-arrow, l
380 Scroll view to the right N increments (default: 1).
382 File output moves left on the screen.
384 Scroll view to the left N increments (default: 1).
386 File output moves right on the screen.
388 Scroll view to the rightmost position.
390 Scroll view left to the start of the line.
391 .It Cm Page-down, Space, Ctrl+f, f
392 Move the selection cursor down N pages (default: 1).
393 .It Cm Page-up, Ctrl+b, b
394 Move the selection cursor up N pages (default: 1).
396 Move the selection cursor down N half pages (default: 1).
398 Move the selection cursor up N half pages (default: 1).
400 Move the selection cursor to the first line of the file.
402 Move the selection cursor to the last line of the file.
406 view for the currently selected line's commit.
410 view with the version of the file as found in the currently
411 selected line's commit.
415 view with the version of the file as found in the parent commit of the
416 currently selected line's commit.
420 view with the previously blamed commit.
424 view for the currently selected annotated line.
426 Prompt for a search pattern and start searching for matching lines.
427 The search pattern is an extended regular expression.
428 Regular expression syntax is documented in
431 Find the Nth next line which matches the current search pattern (default: 1).
433 Find the Nth previous line which matches the current search pattern
436 Change the diff algorithm.
437 Supported diff algorithms are Myers (quick and dirty) and
438 Patience (slow and tidy).
439 This is a global setting which also affects the
449 Start traversing history at the specified
451 The expected argument is the name of a branch or a commit ID SHA1 hash.
452 An abbreviated hash argument will be expanded to a full SHA1 hash
453 automatically, provided the abbreviation is unique.
454 .It Fl r Ar repository-path
455 Use the repository at the specified path.
456 If not specified, assume the repository is located at or above the current
458 If this directory is a
460 work tree, use the repository path associated with this work tree.
462 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
463 Display the repository tree.
466 is specified, show tree entries at this path.
468 Displayed tree entries may carry one of the following trailing annotations:
469 .Bl -column YXZ description
470 .It @ Ta entry is a symbolic link
471 .It / Ta entry is a directory
472 .It * Ta entry is an executable file
473 .It $ Ta entry is a Git submodule
476 Symbolic link entries are also annotated with the target path of the link.
480 are as follows (N denotes optional prefixed count modifier):
482 .It Cm Down-arrow, j, Ctrl-n
483 Move the selection cursor down N lines (default: 1).
484 .It Cm Up-arrow, k, Ctrl-p
485 Move the selection cursor up N lines (default: 1).
486 .It Cm Page-down, Space, Ctrl+f, f
487 Move the selection cursor down N pages (default: 1).
488 .It Cm Page-up, Ctrl+b, b
489 Move the selection cursor up N pages (default: 1).
491 Move the selection cursor down N half pages (default: 1).
493 Move the selection cursor up N half pages (default: 1).
495 Move the selection cursor to the first entry.
497 Move the selection cursor to the last entry.
499 Enter the currently selected directory, or switch to the
501 view for the currently selected file.
505 view for the currently selected tree entry.
509 view listing all references in the repository.
510 This can then be used to open a new
512 view for arbitrary branches and tags.
514 Move back to the Nth parent directory (default: 1).
516 Show object IDs for all objects displayed in the
520 Prompt for a search pattern and start searching for matching tree entries.
521 The search pattern is an extended regular expression which is matched
522 against the tree entry's name.
523 Regular expression syntax is documented in
526 Find the Nth next tree entry which matches the current search pattern
529 Find the Nth previous tree entry which matches the current search pattern
538 Start traversing history at the specified
540 The expected argument is the name of a branch or a commit ID SHA1 hash.
541 An abbreviated hash argument will be expanded to a full SHA1 hash
542 automatically, provided the abbreviation is unique.
543 .It Fl r Ar repository-path
544 Use the repository at the specified path.
545 If not specified, assume the repository is located at or above the current
547 If this directory is a
549 work tree, use the repository path associated with this work tree.
551 .It Cm ref Oo Fl r Ar repository-path Oc
552 Display references in the repository.
556 are as follows (N denotes optional prefixed count modifier):
558 .It Cm Down-arrow, j, Ctrl-n
559 Move the selection cursor down N lines (default: 1).
560 .It Cm Up-arrow, k, Ctrl-p
561 Move the selection cursor up N lines (default: 1).
562 .It Cm Page-down, Space, Ctrl+f, f
563 Move the selection cursor down N pages (default: 1).
564 .It Cm Page-up, Ctrl+b, b
565 Move the selection cursor up N pages (default: 1).
567 Move the selection cursor down N half pages (default: 1).
569 Move the selection cursor up N half pages (default: 1).
571 Move the selection cursor to the first reference.
573 Move the selection cursor to the last reference.
577 view which begins traversing history at the commit resolved via the
578 currently selected reference.
582 view showing the tree resolved via the currently selected reference.
584 Show object IDs for all non-symbolic references displayed in the
588 Show last modified date of each displayed reference.
590 Toggle display order of references between sort by name and sort by timestamp.
592 Prompt for a search pattern and start searching for matching references.
593 The search pattern is an extended regular expression which is matched
594 against absolute reference names.
595 Regular expression syntax is documented in
598 Find the Nth next reference which matches the current search pattern
601 Find the Nth previous reference which matches the current search pattern
604 Reload the list of references displayed by the
613 .It Fl r Ar repository-path
614 Use the repository at the specified path.
615 If not specified, assume the repository is located at or above the current
617 If this directory is a
619 work tree, use the repository path associated with this work tree.
623 .Bl -tag -width TOG_VIEW_SPLIT_MODE
624 .It Ev TOG_DIFF_ALGORITHM
625 Determines the default diff algorithm used by
627 Supported diff algorithms are Myers (quick and dirty) and
628 Patience (slow and tidy).
630 .Ev TOG_DIFF_ALGORITHM
635 If unset, the Myers diff algorithm will be used by default.
636 .It Ev TOG_VIEW_SPLIT_MODE
637 Determines the default layout of split-screen views.
643 will use horizontal split by default.
644 Otherwise, vertical split will be used.
647 key can be used to switch between vertical and horizontal split layout
651 shows colorized output if this variable is set to a non-empty value.
652 The default color scheme can be modified by setting the environment
653 variables documented below.
654 The colors available in color schemes are
664 which maps to the terminal's default foreground color.
665 .It Ev TOG_COLOR_DIFF_MINUS
666 The color used to mark up removed lines in diffs.
667 If not set, the default value
670 .It Ev TOG_COLOR_DIFF_PLUS
671 The color used to mark up added lines in diffs.
672 If not set, the default value
675 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
676 The color used to mark up chunk header lines in diffs.
677 If not set, the default value
680 .It Ev TOG_COLOR_DIFF_META
681 The color used to mark up meta data in diffs.
682 If not set, the default value
685 .It Ev TOG_COLOR_TREE_SUBMODULE
686 The color used to mark up submodule tree entries.
687 If not set, the default value
690 .It Ev TOG_COLOR_TREE_SYMLINK
691 The color used to mark up symbolic link tree entries.
692 If not set, the default value
695 .It Ev TOG_COLOR_TREE_DIRECTORY
696 The color used to mark up directory tree entries.
697 If not set, the default value
700 .It Ev TOG_COLOR_TREE_EXECUTABLE
701 The color used to mark up executable file tree entries.
702 If not set, the default value
705 .It Ev TOG_COLOR_COMMIT
706 The color used to mark up commit IDs.
707 If not set, the default value
710 .It Ev TOG_COLOR_AUTHOR
711 The color used to mark up author information.
712 If not set, the default value
715 .It Ev TOG_COLOR_DATE
716 The color used to mark up date information.
717 If not set, the default value
720 .It Ev TOG_COLOR_REFS_HEADS
721 The color used to mark up references in the
724 If not set, the default value
727 .It Ev TOG_COLOR_REFS_TAGS
728 The color used to mark up references in the
731 If not set, the default value
734 .It Ev TOG_COLOR_REFS_REMOTES
735 The color used to mark up references in the
738 If not set, the default value
741 .It Ev TOG_COLOR_REFS_BACKUP
742 The color used to mark up references in the
745 If not set, the default value
753 .Xr git-repository 5 ,
756 .An Christian Weisgerber Aq Mt naddy@openbsd.org
757 .An Josh Rickmar Aq Mt jrick@zettaport.com
758 .An Joshua Stein Aq Mt jcs@openbsd.org
759 .An Mark Jamsek Aq Mt mark@jamsek.dev
760 .An Martin Pieuchot Aq Mt mpi@openbsd.org
761 .An Omar Polo Aq Mt op@openbsd.org
762 .An Stefan Sperling Aq Mt stsp@openbsd.org
763 .An Klemens Nanni Aq Mt kn@openbsd.org