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.
61 When the first integer for a count modifier is entered,
63 will wait 500 milliseconds for each successive integer or the compound sequence
65 If this sequence should timeout or does not conclude with a valid key binding,
66 the command is aborted and any preceding count is reset.
67 The global key bindings are:
73 Quit the view which is in focus.
75 Switch focus between views.
77 Toggle fullscreen mode for a split-screen view.
79 will automatically use split-screen views if the size of the terminal
80 window is sufficiently large.
83 Global options must precede the command name, and are as follows:
84 .Bl -tag -width tenletters
86 Display usage information.
88 Display program version and exit immediately.
95 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
96 Display history of a repository.
99 is specified, show only commits which modified this path.
100 If invoked in a work tree, the
102 is interpreted relative to the current working directory,
103 and the work tree's path prefix is implicitly prepended.
104 Otherwise, the path is interpreted relative to the repository root.
106 This command is also executed if no explicit command is specified.
110 are as follows (N denotes optional prefixed count modifier):
112 .It Cm Down-arrow, j, >, Full stop, Ctrl-n
113 Move the selection cursor down N lines (default: 1).
114 .It Cm Up-arrow, k, <, Comma, Ctrl-p
115 Move the selection cursor up N lines (default: 1).
116 .It Cm Right-arrow, l
117 Scroll log message field to the right N increments (default: 1).
119 Log message moves left on the screen.
121 Scroll log message field to the left N increments (default: 1).
123 Log message moves right on the screen.
125 Scroll log message field to the rightmost position.
127 Scroll log message field to the leftmost position.
128 .It Cm Page-down, Space, Ctrl+f, f
129 Move the selection cursor down N pages (default: 1).
130 .It Cm Page-up, Ctrl+b, b
131 Move the selection cursor up N pages (default: 1).
133 Move the selection cursor down N half pages (default: 1).
135 Move the selection cursor up N half pages (default: 1).
137 Move the cursor to the newest commit.
139 Move the cursor to the oldest commit.
140 This will traverse all commits on the current branch which may take
141 a long time depending on the number of commits in branch history.
142 If needed, this operation can be cancelled with
147 view showing file changes made in the currently selected commit.
151 view showing the tree for the currently selected commit.
153 Show log entries for the parent directory of the currently selected path.
154 However when an active search is in progress or when additional commits
157 aborts the running operation.
159 Prompt for a search pattern and start searching for matching commits.
160 The search pattern is an extended regular expression which is matched
161 against a commit's author name, committer name, log message, and
163 Regular expression syntax is documented in
166 Find the Nth next commit which matches the current search pattern (default: 1).
168 Searching continues until either a match is found or the
172 Find the Nth previous commit which matches the current search pattern
175 Searching continues until either a match is found or the
181 view with new commits found in the repository.
185 view and toggle display of merged commits.
188 option determines whether merged commits are displayed initially.
192 view listing all references in the repository.
193 This can then be used to open a new
195 view for arbitrary branches and tags.
203 Display individual commits which were merged into the current branch
207 shows the linear history of the current branch only.
210 key binding can be used to toggle display of merged commits at run-time.
212 Start traversing history at the specified
214 The expected argument is the name of a branch or a commit ID SHA1 hash.
215 An abbreviated hash argument will be expanded to a full SHA1 hash
216 automatically, provided the abbreviation is unique.
217 If this option is not specified, default to the work tree's current branch
218 if invoked in a work tree, or to the repository's HEAD reference.
219 .It Fl r Ar repository-path
220 Use the repository at the specified path.
221 If not specified, assume the repository is located at or above the current
223 If this directory is a
225 work tree, use the repository path associated with this work tree.
227 .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
228 Display the differences between two objects in the repository.
229 Treat each of the two arguments as a reference, a tag name, or an object
230 ID SHA1 hash, and display differences between the corresponding objects.
231 Both objects must be of the same type (blobs, trees, or commits).
232 An abbreviated hash argument will be expanded to a full SHA1 hash
233 automatically, provided the abbreviation is unique.
237 are as follows (N denotes optional prefixed count modifier):
240 Toggle treatment of file contents as ASCII text even if binary data was
242 .It Cm Down-arrow, j, Ctrl-n
243 Scroll down N lines (default: 1).
244 .It Cm Up-arrow, k, Ctrl-p
245 Scroll up N lines (default: 1).
246 .It Cm Right-arrow, l
247 Scroll view to the right N increments (default: 1).
249 Diff output moves left on the screen.
251 Scroll view to the left N increments (default: 1).
253 Diff output moves right on the screen.
255 Scroll view to the rightmost position.
257 Scroll view left to the start of the line.
258 .It Cm Page-down, Space, Ctrl+f, f
259 Scroll down N pages (default: 1).
260 .It Cm Page-up, Ctrl+b, b
261 Scroll up N pages (default: 1).
263 Scroll down N half pages (default: 1).
265 Scroll up N half pages (default: 1).
267 Scroll to the top of the view.
269 Scroll to the bottom of the view.
271 Reduce diff context by N lines (default: 1).
273 Increase diff context by N lines (default: 1).
277 view was opened via the
279 view, move to the Nth previous (younger) commit (default: 1).
283 view was opened via the
285 view, move to the Nth next (older) commit (default: 1).
287 Prompt for a search pattern and start searching for matching lines.
288 The search pattern is an extended regular expression.
289 Regular expression syntax is documented in
292 Find the Nth next line which matches the current search pattern (default: 1).
294 Find the Nth previous line which matches the current search pattern
297 Toggle display of whitespace-only changes.
299 Change the diff algorithm.
300 Supported diff algorithms are Myers and Patience.
301 This is a global setting which also affects the
311 Treat file contents as ASCII text even if binary data is detected.
313 Set the number of context lines shown in the diff.
314 By default, 3 lines of context are shown.
315 .It Fl r Ar repository-path
316 Use the repository at the specified path.
317 If not specified, assume the repository is located at or above the current
319 If this directory is a
321 work tree, use the repository path associated with this work tree.
323 Ignore whitespace-only changes.
325 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
326 Display line-by-line history of a file at the specified path.
330 are as follows (N denotes optional prefixed count modifier):
332 .It Cm Down-arrow, j, Ctrl-n
333 Move the selection cursor down N pages (default: 1).
334 .It Cm Up-arrow, k, Ctrl-p
335 Move the selection cursor up N pages (default: 1).
336 .It Cm Right-arrow, l
337 Scroll view to the right N increments (default: 1).
339 File output moves left on the screen.
341 Scroll view to the left N increments (default: 1).
343 File output moves right on the screen.
345 Scroll view to the rightmost position.
347 Scroll view left to the start of the line.
348 .It Cm Page-down, Space, Ctrl+f, f
349 Move the selection cursor down N pages (default: 1).
350 .It Cm Page-up, Ctrl+b, b
351 Move the selection cursor up N pages (default: 1).
353 Move the selection cursor down N half pages (default: 1).
355 Move the selection cursor up N half pages (default: 1).
357 Move the selection cursor to the first line of the file.
359 Move the selection cursor to the last line of the file.
363 view for the currently selected line's commit.
367 view with the version of the file as found in the currently
368 selected line's commit.
372 view with the version of the file as found in the parent commit of the
373 currently selected line's commit.
377 view with the previously blamed commit.
379 Prompt for a search pattern and start searching for matching lines.
380 The search pattern is an extended regular expression.
381 Regular expression syntax is documented in
384 Find the Nth next line which matches the current search pattern (default: 1).
386 Find the Nth previous line which matches the current search pattern
389 Change the diff algorithm.
390 Supported diff algorithms are Myers and Patience.
391 This is a global setting which also affects the
401 Start traversing history at the specified
403 The expected argument is the name of a branch or a commit ID SHA1 hash.
404 An abbreviated hash argument will be expanded to a full SHA1 hash
405 automatically, provided the abbreviation is unique.
406 .It Fl r Ar repository-path
407 Use the repository at the specified path.
408 If not specified, assume the repository is located at or above the current
410 If this directory is a
412 work tree, use the repository path associated with this work tree.
414 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
415 Display the repository tree.
418 is specified, show tree entries at this path.
420 Displayed tree entries may carry one of the following trailing annotations:
421 .Bl -column YXZ description
422 .It @ Ta entry is a symbolic link
423 .It / Ta entry is a directory
424 .It * Ta entry is an executable file
425 .It $ Ta entry is a Git submodule
428 Symbolic link entries are also annotated with the target path of the link.
432 are as follows (N denotes optional prefixed count modifier):
434 .It Cm Down-arrow, j, Ctrl-n
435 Move the selection cursor down N lines (default: 1).
436 .It Cm Up-arrow, k, Ctrl-p
437 Move the selection cursor up N lines (default: 1).
438 .It Cm Page-down, Space, Ctrl+f, f
439 Move the selection cursor down N pages (default: 1).
440 .It Cm Page-up, Ctrl+b, b
441 Move the selection cursor up N pages (default: 1).
443 Move the selection cursor down N half pages (default: 1).
445 Move the selection cursor up N half pages (default: 1).
447 Move the selection cursor to the first entry.
449 Move the selection cursor to the last entry.
451 Enter the currently selected directory, or switch to the
453 view for the currently selected file.
457 view for the currently selected tree entry.
461 view listing all references in the repository.
462 This can then be used to open a new
464 view for arbitrary branches and tags.
466 Move back to the Nth parent directory (default: 1).
468 Show object IDs for all objects displayed in the
472 Prompt for a search pattern and start searching for matching tree entries.
473 The search pattern is an extended regular expression which is matched
474 against the tree entry's name.
475 Regular expression syntax is documented in
478 Find the Nth next tree entry which matches the current search pattern
481 Find the Nth previous tree entry which matches the current search pattern
490 Start traversing history at the specified
492 The expected argument is the name of a branch or a commit ID SHA1 hash.
493 An abbreviated hash argument will be expanded to a full SHA1 hash
494 automatically, provided the abbreviation is unique.
495 .It Fl r Ar repository-path
496 Use the repository at the specified path.
497 If not specified, assume the repository is located at or above the current
499 If this directory is a
501 work tree, use the repository path associated with this work tree.
503 .It Cm ref Oo Fl r Ar repository-path Oc
504 Display references in the repository.
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 reference.
525 Move the selection cursor to the last reference.
529 view which begins traversing history at the commit resolved via the
530 currently selected reference.
534 view showing the tree resolved via the currently selected reference.
536 Show object IDs for all non-symbolic references displayed in the
540 Show last modified date of each displayed reference.
542 Toggle display order of references between sort by name and sort by timestamp.
544 Prompt for a search pattern and start searching for matching references.
545 The search pattern is an extended regular expression which is matched
546 against absolute reference names.
547 Regular expression syntax is documented in
550 Find the Nth next reference which matches the current search pattern
553 Find the Nth previous reference which matches the current search pattern
556 Reload the list of references displayed by the
565 .It Fl r Ar repository-path
566 Use the repository at the specified path.
567 If not specified, assume the repository is located at or above the current
569 If this directory is a
571 work tree, use the repository path associated with this work tree.
575 .Bl -tag -width TOG_DIFF_ALGORITHM
576 .It Ev TOG_DIFF_ALGORITHM
577 Determines the default diff algorithm used by
583 If unset, the Myers diff algorithm will be used by default.
586 shows colorized output if this variable is set to a non-empty value.
587 The default color scheme can be modified by setting the environment
588 variables documented below.
589 The colors available in color schemes are
599 which maps to the terminal's default foreground color.
600 .It Ev TOG_COLOR_DIFF_MINUS
601 The color used to mark up removed lines in diffs.
602 If not set, the default value
605 .It Ev TOG_COLOR_DIFF_PLUS
606 The color used to mark up added lines in diffs.
607 If not set, the default value
610 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
611 The color used to mark up chunk header lines in diffs.
612 If not set, the default value
615 .It Ev TOG_COLOR_DIFF_META
616 The color used to mark up meta data in diffs.
617 If not set, the default value
620 .It Ev TOG_COLOR_TREE_SUBMODULE
621 The color used to mark up submodule tree entries.
622 If not set, the default value
625 .It Ev TOG_COLOR_TREE_SYMLINK
626 The color used to mark up symbolic link tree entries.
627 If not set, the default value
630 .It Ev TOG_COLOR_TREE_DIRECTORY
631 The color used to mark up directory tree entries.
632 If not set, the default value
635 .It Ev TOG_COLOR_TREE_EXECUTABLE
636 The color used to mark up executable file tree entries.
637 If not set, the default value
640 .It Ev TOG_COLOR_COMMIT
641 The color used to mark up commit IDs.
642 If not set, the default value
645 .It Ev TOG_COLOR_AUTHOR
646 The color used to mark up author information.
647 If not set, the default value
650 .It Ev TOG_COLOR_DATE
651 The color used to mark up date information.
652 If not set, the default value
655 .It Ev TOG_COLOR_REFS_HEADS
656 The color used to mark up references in the
659 If not set, the default value
662 .It Ev TOG_COLOR_REFS_TAGS
663 The color used to mark up references in the
666 If not set, the default value
669 .It Ev TOG_COLOR_REFS_REMOTES
670 The color used to mark up references in the
673 If not set, the default value
676 .It Ev TOG_COLOR_REFS_BACKUP
677 The color used to mark up references in the
680 If not set, the default value
688 .Xr git-repository 5 ,
691 .An Stefan Sperling Aq Mt stsp@openbsd.org
692 .An Joshua Stein Aq Mt jcs@openbsd.org