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.
85 Global options must precede the command name, and are as follows:
86 .Bl -tag -width tenletters
88 Display usage information.
90 Display program version and exit immediately.
97 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
98 Display history of a repository.
101 is specified, show only commits which modified this path.
102 If invoked in a work tree, the
104 is interpreted relative to the current working directory,
105 and the work tree's path prefix is implicitly prepended.
106 Otherwise, the path is interpreted relative to the repository root.
108 This command is also executed if no explicit command is specified.
112 are as follows (N denotes optional prefixed count modifier):
114 .It Cm Down-arrow, j, >, Full stop, Ctrl-n
115 Move the selection cursor down N lines (default: 1).
116 .It Cm Up-arrow, k, <, Comma, Ctrl-p
117 Move the selection cursor up N lines (default: 1).
118 .It Cm Right-arrow, l
119 Scroll log message field to the right N increments (default: 1).
121 Log message moves left on the screen.
123 Scroll log message field to the left N increments (default: 1).
125 Log message moves right on the screen.
127 Scroll log message field to the rightmost position.
129 Scroll log message field to the leftmost position.
130 .It Cm Page-down, Space, Ctrl+f, f
131 Move the selection cursor down N pages (default: 1).
132 .It Cm Page-up, Ctrl+b, b
133 Move the selection cursor up N pages (default: 1).
135 Move the selection cursor down N half pages (default: 1).
137 Move the selection cursor up N half pages (default: 1).
139 Move the cursor to the newest commit.
141 Move the cursor to the oldest commit.
142 This will traverse all commits on the current branch which may take
143 a long time depending on the number of commits in branch history.
144 If needed, this operation can be cancelled with
151 view showing file changes made in the currently selected commit.
155 view showing the tree for the currently selected commit.
157 Show log entries for the parent directory of the currently selected path.
158 However when an active search is in progress or when additional commits
161 aborts the running operation.
163 Prompt for a search pattern and start searching for matching commits.
164 The search pattern is an extended regular expression which is matched
165 against a commit's author name, committer name, log message, and
167 Regular expression syntax is documented in
170 Find the Nth next commit which matches the current search pattern (default: 1).
172 Searching continues until either a match is found or
178 Find the Nth previous commit which matches the current search pattern
181 Searching continues until either a match is found or
189 view with new commits found in the repository.
193 view and toggle display of merged commits.
196 option determines whether merged commits are displayed initially.
200 view listing all references in the repository.
201 This can then be used to open a new
203 view for arbitrary branches and tags.
211 Display individual commits which were merged into the current branch
215 shows the linear history of the current branch only.
218 key binding can be used to toggle display of merged commits at run-time.
220 Start traversing history at the specified
222 The expected argument is the name of a branch or a commit ID SHA1 hash.
223 An abbreviated hash argument will be expanded to a full SHA1 hash
224 automatically, provided the abbreviation is unique.
225 If this option is not specified, default to the work tree's current branch
226 if invoked in a work tree, or to the repository's HEAD reference.
227 .It Fl r Ar repository-path
228 Use the repository at the specified path.
229 If not specified, assume the repository is located at or above the current
231 If this directory is a
233 work tree, use the repository path associated with this work tree.
235 .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
236 Display the differences between two objects in the repository.
237 Treat each of the two arguments as a reference, a tag name, or an object
238 ID SHA1 hash, and display differences between the corresponding objects.
239 Both objects must be of the same type (blobs, trees, or commits).
240 An abbreviated hash argument will be expanded to a full SHA1 hash
241 automatically, provided the abbreviation is unique.
245 are as follows (N denotes optional prefixed count modifier):
248 Toggle treatment of file contents as ASCII text even if binary data was
250 .It Cm Down-arrow, j, Ctrl-n
251 Scroll down N lines (default: 1).
252 .It Cm Up-arrow, k, Ctrl-p
253 Scroll up N lines (default: 1).
254 .It Cm Right-arrow, l
255 Scroll view to the right N increments (default: 1).
257 Diff output moves left on the screen.
259 Scroll view to the left N increments (default: 1).
261 Diff output moves right on the screen.
263 Scroll view to the rightmost position.
265 Scroll view left to the start of the line.
266 .It Cm Page-down, Space, Ctrl+f, f
267 Scroll down N pages (default: 1).
268 .It Cm Page-up, Ctrl+b, b
269 Scroll up N pages (default: 1).
271 Scroll down N half pages (default: 1).
273 Scroll up N half pages (default: 1).
275 Scroll to the top of the view.
277 Scroll to the bottom of the view.
279 Reduce diff context by N lines (default: 1).
281 Increase diff context by N lines (default: 1).
285 view was opened via the
287 view, move to the Nth previous (younger) commit (default: 1).
291 view was opened via the
293 view, move to the Nth next (older) commit (default: 1).
295 Prompt for a search pattern and start searching for matching lines.
296 The search pattern is an extended regular expression.
297 Regular expression syntax is documented in
300 Find the Nth next line which matches the current search pattern (default: 1).
302 Find the Nth previous line which matches the current search pattern
305 Toggle display of whitespace-only changes.
307 Change the diff algorithm.
308 Supported diff algorithms are Myers (quick and dirty) and
309 Patience (slow and tidy).
310 This is a global setting which also affects the
320 Treat file contents as ASCII text even if binary data is detected.
322 Set the number of context lines shown in the diff.
323 By default, 3 lines of context are shown.
324 .It Fl r Ar repository-path
325 Use the repository at the specified path.
326 If not specified, assume the repository is located at or above the current
328 If this directory is a
330 work tree, use the repository path associated with this work tree.
332 Ignore whitespace-only changes.
334 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
335 Display line-by-line history of a file at the specified path.
339 are as follows (N denotes optional prefixed count modifier):
341 .It Cm Down-arrow, j, Ctrl-n
342 Move the selection cursor down N pages (default: 1).
343 .It Cm Up-arrow, k, Ctrl-p
344 Move the selection cursor up N pages (default: 1).
345 .It Cm Right-arrow, l
346 Scroll view to the right N increments (default: 1).
348 File output moves left on the screen.
350 Scroll view to the left N increments (default: 1).
352 File output moves right on the screen.
354 Scroll view to the rightmost position.
356 Scroll view left to the start of the line.
357 .It Cm Page-down, Space, Ctrl+f, f
358 Move the selection cursor down N pages (default: 1).
359 .It Cm Page-up, Ctrl+b, b
360 Move the selection cursor up N pages (default: 1).
362 Move the selection cursor down N half pages (default: 1).
364 Move the selection cursor up N half pages (default: 1).
366 Move the selection cursor to the first line of the file.
368 Move the selection cursor to the last line of the file.
372 view for the currently selected line's commit.
376 view with the version of the file as found in the currently
377 selected line's commit.
381 view with the version of the file as found in the parent commit of the
382 currently selected line's commit.
386 view with the previously blamed commit.
388 Prompt for a search pattern and start searching for matching lines.
389 The search pattern is an extended regular expression.
390 Regular expression syntax is documented in
393 Find the Nth next line which matches the current search pattern (default: 1).
395 Find the Nth previous line which matches the current search pattern
398 Change the diff algorithm.
399 Supported diff algorithms are Myers (quick and dirty) and
400 Patience (slow and tidy).
401 This is a global setting which also affects the
411 Start traversing history at the specified
413 The expected argument is the name of a branch or a commit ID SHA1 hash.
414 An abbreviated hash argument will be expanded to a full SHA1 hash
415 automatically, provided the abbreviation is unique.
416 .It Fl r Ar repository-path
417 Use the repository at the specified path.
418 If not specified, assume the repository is located at or above the current
420 If this directory is a
422 work tree, use the repository path associated with this work tree.
424 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
425 Display the repository tree.
428 is specified, show tree entries at this path.
430 Displayed tree entries may carry one of the following trailing annotations:
431 .Bl -column YXZ description
432 .It @ Ta entry is a symbolic link
433 .It / Ta entry is a directory
434 .It * Ta entry is an executable file
435 .It $ Ta entry is a Git submodule
438 Symbolic link entries are also annotated with the target path of the link.
442 are as follows (N denotes optional prefixed count modifier):
444 .It Cm Down-arrow, j, Ctrl-n
445 Move the selection cursor down N lines (default: 1).
446 .It Cm Up-arrow, k, Ctrl-p
447 Move the selection cursor up N lines (default: 1).
448 .It Cm Page-down, Space, Ctrl+f, f
449 Move the selection cursor down N pages (default: 1).
450 .It Cm Page-up, Ctrl+b, b
451 Move the selection cursor up N pages (default: 1).
453 Move the selection cursor down N half pages (default: 1).
455 Move the selection cursor up N half pages (default: 1).
457 Move the selection cursor to the first entry.
459 Move the selection cursor to the last entry.
461 Enter the currently selected directory, or switch to the
463 view for the currently selected file.
467 view for the currently selected tree entry.
471 view listing all references in the repository.
472 This can then be used to open a new
474 view for arbitrary branches and tags.
476 Move back to the Nth parent directory (default: 1).
478 Show object IDs for all objects displayed in the
482 Prompt for a search pattern and start searching for matching tree entries.
483 The search pattern is an extended regular expression which is matched
484 against the tree entry's name.
485 Regular expression syntax is documented in
488 Find the Nth next tree entry which matches the current search pattern
491 Find the Nth previous tree entry which matches the current search pattern
500 Start traversing history at the specified
502 The expected argument is the name of a branch or a commit ID SHA1 hash.
503 An abbreviated hash argument will be expanded to a full SHA1 hash
504 automatically, provided the abbreviation is unique.
505 .It Fl r Ar repository-path
506 Use the repository at the specified path.
507 If not specified, assume the repository is located at or above the current
509 If this directory is a
511 work tree, use the repository path associated with this work tree.
513 .It Cm ref Oo Fl r Ar repository-path Oc
514 Display references in the repository.
518 are as follows (N denotes optional prefixed count modifier):
520 .It Cm Down-arrow, j, Ctrl-n
521 Move the selection cursor down N lines (default: 1).
522 .It Cm Up-arrow, k, Ctrl-p
523 Move the selection cursor up N lines (default: 1).
524 .It Cm Page-down, Space, Ctrl+f, f
525 Move the selection cursor down N pages (default: 1).
526 .It Cm Page-up, Ctrl+b, b
527 Move the selection cursor up N pages (default: 1).
529 Move the selection cursor down N half pages (default: 1).
531 Move the selection cursor up N half pages (default: 1).
533 Move the selection cursor to the first reference.
535 Move the selection cursor to the last reference.
539 view which begins traversing history at the commit resolved via the
540 currently selected reference.
544 view showing the tree resolved via the currently selected reference.
546 Show object IDs for all non-symbolic references displayed in the
550 Show last modified date of each displayed reference.
552 Toggle display order of references between sort by name and sort by timestamp.
554 Prompt for a search pattern and start searching for matching references.
555 The search pattern is an extended regular expression which is matched
556 against absolute reference names.
557 Regular expression syntax is documented in
560 Find the Nth next reference which matches the current search pattern
563 Find the Nth previous reference which matches the current search pattern
566 Reload the list of references displayed by the
575 .It Fl r Ar repository-path
576 Use the repository at the specified path.
577 If not specified, assume the repository is located at or above the current
579 If this directory is a
581 work tree, use the repository path associated with this work tree.
585 .Bl -tag -width TOG_DIFF_ALGORITHM
586 .It Ev TOG_DIFF_ALGORITHM
587 Determines the default diff algorithm used by
589 Supported diff algorithms are Myers (quick and dirty) and
590 Patience (slow and tidy).
592 .Ev TOG_DIFF_ALGORITHM
597 If unset, the Myers diff algorithm will be used by default.
598 .It Ev TOG_VIEW_SPLIT_MODE
601 will use vertical or horizontal split for split-screen views.
604 then split-screen views will be split horizontally.
605 Otherwise, split-screen views will be split vertically.
608 shows colorized output if this variable is set to a non-empty value.
609 The default color scheme can be modified by setting the environment
610 variables documented below.
611 The colors available in color schemes are
621 which maps to the terminal's default foreground color.
622 .It Ev TOG_COLOR_DIFF_MINUS
623 The color used to mark up removed lines in diffs.
624 If not set, the default value
627 .It Ev TOG_COLOR_DIFF_PLUS
628 The color used to mark up added lines in diffs.
629 If not set, the default value
632 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
633 The color used to mark up chunk header lines in diffs.
634 If not set, the default value
637 .It Ev TOG_COLOR_DIFF_META
638 The color used to mark up meta data in diffs.
639 If not set, the default value
642 .It Ev TOG_COLOR_TREE_SUBMODULE
643 The color used to mark up submodule tree entries.
644 If not set, the default value
647 .It Ev TOG_COLOR_TREE_SYMLINK
648 The color used to mark up symbolic link tree entries.
649 If not set, the default value
652 .It Ev TOG_COLOR_TREE_DIRECTORY
653 The color used to mark up directory tree entries.
654 If not set, the default value
657 .It Ev TOG_COLOR_TREE_EXECUTABLE
658 The color used to mark up executable file tree entries.
659 If not set, the default value
662 .It Ev TOG_COLOR_COMMIT
663 The color used to mark up commit IDs.
664 If not set, the default value
667 .It Ev TOG_COLOR_AUTHOR
668 The color used to mark up author information.
669 If not set, the default value
672 .It Ev TOG_COLOR_DATE
673 The color used to mark up date information.
674 If not set, the default value
677 .It Ev TOG_COLOR_REFS_HEADS
678 The color used to mark up references in the
681 If not set, the default value
684 .It Ev TOG_COLOR_REFS_TAGS
685 The color used to mark up references in the
688 If not set, the default value
691 .It Ev TOG_COLOR_REFS_REMOTES
692 The color used to mark up references in the
695 If not set, the default value
698 .It Ev TOG_COLOR_REFS_BACKUP
699 The color used to mark up references in the
702 If not set, the default value
710 .Xr git-repository 5 ,
713 .An Christian Weisgerber Aq Mt naddy@openbsd.org
714 .An Josh Rickmar Aq Mt jrick@zettaport.com
715 .An Joshua Stein Aq Mt jcs@openbsd.org
716 .An Mark Jamsek Aq Mt mark@jamsek.dev
717 .An Martin Pieuchot Aq Mt mpi@openbsd.org
718 .An Omar Polo Aq Mt op@openbsd.org
719 .An Stefan Sperling Aq Mt stsp@openbsd.org
720 .An Klemens Nanni Aq Mt kn@openbsd.org