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 When in a split-screen view,
86 will switch to the alternate split mode.
87 If the current view is in a horizontal split and the terminal window is not
88 wide enough, the view will remain unchanged.
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 (default: 1).
303 view was opened via the
305 view, move to the Nth next (older) commit (default: 1).
307 Prompt for a search pattern and start searching for matching lines.
308 The search pattern is an extended regular expression.
309 Regular expression syntax is documented in
312 Find the Nth next line which matches the current search pattern (default: 1).
314 Find the Nth previous line which matches the current search pattern
317 Toggle display of whitespace-only changes.
319 Change the diff algorithm.
320 Supported diff algorithms are Myers (quick and dirty) and
321 Patience (slow and tidy).
322 This is a global setting which also affects the
332 Treat file contents as ASCII text even if binary data is detected.
334 Set the number of context lines shown in the diff.
335 By default, 3 lines of context are shown.
336 .It Fl r Ar repository-path
337 Use the repository at the specified path.
338 If not specified, assume the repository is located at or above the current
340 If this directory is a
342 work tree, use the repository path associated with this work tree.
344 Ignore whitespace-only changes.
346 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
347 Display line-by-line history of a file at the specified path.
351 are as follows (N denotes optional prefixed count modifier):
353 .It Cm Down-arrow, j, Ctrl-n
354 Move the selection cursor down N pages (default: 1).
355 .It Cm Up-arrow, k, Ctrl-p
356 Move the selection cursor up N pages (default: 1).
357 .It Cm Right-arrow, l
358 Scroll view to the right N increments (default: 1).
360 File output moves left on the screen.
362 Scroll view to the left N increments (default: 1).
364 File output moves right on the screen.
366 Scroll view to the rightmost position.
368 Scroll view left to the start of the line.
369 .It Cm Page-down, Space, Ctrl+f, f
370 Move the selection cursor down N pages (default: 1).
371 .It Cm Page-up, Ctrl+b, b
372 Move the selection cursor up N pages (default: 1).
374 Move the selection cursor down N half pages (default: 1).
376 Move the selection cursor up N half pages (default: 1).
378 Move the selection cursor to the first line of the file.
380 Move the selection cursor to the last line of the file.
384 view for the currently selected line's commit.
388 view with the version of the file as found in the currently
389 selected line's commit.
393 view with the version of the file as found in the parent commit of the
394 currently selected line's commit.
398 view with the previously blamed commit.
400 Prompt for a search pattern and start searching for matching lines.
401 The search pattern is an extended regular expression.
402 Regular expression syntax is documented in
405 Find the Nth next line which matches the current search pattern (default: 1).
407 Find the Nth previous line which matches the current search pattern
410 Change the diff algorithm.
411 Supported diff algorithms are Myers (quick and dirty) and
412 Patience (slow and tidy).
413 This is a global setting which also affects the
423 Start traversing history at the specified
425 The expected argument is the name of a branch or a commit ID SHA1 hash.
426 An abbreviated hash argument will be expanded to a full SHA1 hash
427 automatically, provided the abbreviation is unique.
428 .It Fl r Ar repository-path
429 Use the repository at the specified path.
430 If not specified, assume the repository is located at or above the current
432 If this directory is a
434 work tree, use the repository path associated with this work tree.
436 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
437 Display the repository tree.
440 is specified, show tree entries at this path.
442 Displayed tree entries may carry one of the following trailing annotations:
443 .Bl -column YXZ description
444 .It @ Ta entry is a symbolic link
445 .It / Ta entry is a directory
446 .It * Ta entry is an executable file
447 .It $ Ta entry is a Git submodule
450 Symbolic link entries are also annotated with the target path of the link.
454 are as follows (N denotes optional prefixed count modifier):
456 .It Cm Down-arrow, j, Ctrl-n
457 Move the selection cursor down N lines (default: 1).
458 .It Cm Up-arrow, k, Ctrl-p
459 Move the selection cursor up N lines (default: 1).
460 .It Cm Page-down, Space, Ctrl+f, f
461 Move the selection cursor down N pages (default: 1).
462 .It Cm Page-up, Ctrl+b, b
463 Move the selection cursor up N pages (default: 1).
465 Move the selection cursor down N half pages (default: 1).
467 Move the selection cursor up N half pages (default: 1).
469 Move the selection cursor to the first entry.
471 Move the selection cursor to the last entry.
473 Enter the currently selected directory, or switch to the
475 view for the currently selected file.
479 view for the currently selected tree entry.
483 view listing all references in the repository.
484 This can then be used to open a new
486 view for arbitrary branches and tags.
488 Move back to the Nth parent directory (default: 1).
490 Show object IDs for all objects displayed in the
494 Prompt for a search pattern and start searching for matching tree entries.
495 The search pattern is an extended regular expression which is matched
496 against the tree entry's name.
497 Regular expression syntax is documented in
500 Find the Nth next tree entry which matches the current search pattern
503 Find the Nth previous tree entry which matches the current search pattern
512 Start traversing history at the specified
514 The expected argument is the name of a branch or a commit ID SHA1 hash.
515 An abbreviated hash argument will be expanded to a full SHA1 hash
516 automatically, provided the abbreviation is unique.
517 .It Fl r Ar repository-path
518 Use the repository at the specified path.
519 If not specified, assume the repository is located at or above the current
521 If this directory is a
523 work tree, use the repository path associated with this work tree.
525 .It Cm ref Oo Fl r Ar repository-path Oc
526 Display references in the repository.
530 are as follows (N denotes optional prefixed count modifier):
532 .It Cm Down-arrow, j, Ctrl-n
533 Move the selection cursor down N lines (default: 1).
534 .It Cm Up-arrow, k, Ctrl-p
535 Move the selection cursor up N lines (default: 1).
536 .It Cm Page-down, Space, Ctrl+f, f
537 Move the selection cursor down N pages (default: 1).
538 .It Cm Page-up, Ctrl+b, b
539 Move the selection cursor up N pages (default: 1).
541 Move the selection cursor down N half pages (default: 1).
543 Move the selection cursor up N half pages (default: 1).
545 Move the selection cursor to the first reference.
547 Move the selection cursor to the last reference.
551 view which begins traversing history at the commit resolved via the
552 currently selected reference.
556 view showing the tree resolved via the currently selected reference.
558 Show object IDs for all non-symbolic references displayed in the
562 Show last modified date of each displayed reference.
564 Toggle display order of references between sort by name and sort by timestamp.
566 Prompt for a search pattern and start searching for matching references.
567 The search pattern is an extended regular expression which is matched
568 against absolute reference names.
569 Regular expression syntax is documented in
572 Find the Nth next reference which matches the current search pattern
575 Find the Nth previous reference which matches the current search pattern
578 Reload the list of references displayed by the
587 .It Fl r Ar repository-path
588 Use the repository at the specified path.
589 If not specified, assume the repository is located at or above the current
591 If this directory is a
593 work tree, use the repository path associated with this work tree.
597 .Bl -tag -width TOG_VIEW_SPLIT_MODE
598 .It Ev TOG_DIFF_ALGORITHM
599 Determines the default diff algorithm used by
601 Supported diff algorithms are Myers (quick and dirty) and
602 Patience (slow and tidy).
604 .Ev TOG_DIFF_ALGORITHM
609 If unset, the Myers diff algorithm will be used by default.
610 .It Ev TOG_VIEW_SPLIT_MODE
613 will use vertical or horizontal split for split-screen views.
616 then split-screen views will be split horizontally.
617 Otherwise, split-screen views will be split vertically.
618 Splits can be manipulated in-session as documented above.
621 shows colorized output if this variable is set to a non-empty value.
622 The default color scheme can be modified by setting the environment
623 variables documented below.
624 The colors available in color schemes are
634 which maps to the terminal's default foreground color.
635 .It Ev TOG_COLOR_DIFF_MINUS
636 The color used to mark up removed lines in diffs.
637 If not set, the default value
640 .It Ev TOG_COLOR_DIFF_PLUS
641 The color used to mark up added lines in diffs.
642 If not set, the default value
645 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
646 The color used to mark up chunk header lines in diffs.
647 If not set, the default value
650 .It Ev TOG_COLOR_DIFF_META
651 The color used to mark up meta data in diffs.
652 If not set, the default value
655 .It Ev TOG_COLOR_TREE_SUBMODULE
656 The color used to mark up submodule tree entries.
657 If not set, the default value
660 .It Ev TOG_COLOR_TREE_SYMLINK
661 The color used to mark up symbolic link tree entries.
662 If not set, the default value
665 .It Ev TOG_COLOR_TREE_DIRECTORY
666 The color used to mark up directory tree entries.
667 If not set, the default value
670 .It Ev TOG_COLOR_TREE_EXECUTABLE
671 The color used to mark up executable file tree entries.
672 If not set, the default value
675 .It Ev TOG_COLOR_COMMIT
676 The color used to mark up commit IDs.
677 If not set, the default value
680 .It Ev TOG_COLOR_AUTHOR
681 The color used to mark up author information.
682 If not set, the default value
685 .It Ev TOG_COLOR_DATE
686 The color used to mark up date information.
687 If not set, the default value
690 .It Ev TOG_COLOR_REFS_HEADS
691 The color used to mark up references in the
694 If not set, the default value
697 .It Ev TOG_COLOR_REFS_TAGS
698 The color used to mark up references in the
701 If not set, the default value
704 .It Ev TOG_COLOR_REFS_REMOTES
705 The color used to mark up references in the
708 If not set, the default value
711 .It Ev TOG_COLOR_REFS_BACKUP
712 The color used to mark up references in the
715 If not set, the default value
723 .Xr git-repository 5 ,
726 .An Christian Weisgerber Aq Mt naddy@openbsd.org
727 .An Josh Rickmar Aq Mt jrick@zettaport.com
728 .An Joshua Stein Aq Mt jcs@openbsd.org
729 .An Mark Jamsek Aq Mt mark@jamsek.dev
730 .An Martin Pieuchot Aq Mt mpi@openbsd.org
731 .An Omar Polo Aq Mt op@openbsd.org
732 .An Stefan Sperling Aq Mt stsp@openbsd.org
733 .An Klemens Nanni Aq Mt kn@openbsd.org