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 and Patience.
309 This is a global setting which also affects the
319 Treat file contents as ASCII text even if binary data is detected.
321 Set the number of context lines shown in the diff.
322 By default, 3 lines of context are shown.
323 .It Fl r Ar repository-path
324 Use the repository at the specified path.
325 If not specified, assume the repository is located at or above the current
327 If this directory is a
329 work tree, use the repository path associated with this work tree.
331 Ignore whitespace-only changes.
333 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
334 Display line-by-line history of a file at the specified path.
338 are as follows (N denotes optional prefixed count modifier):
340 .It Cm Down-arrow, j, Ctrl-n
341 Move the selection cursor down N pages (default: 1).
342 .It Cm Up-arrow, k, Ctrl-p
343 Move the selection cursor up N pages (default: 1).
344 .It Cm Right-arrow, l
345 Scroll view to the right N increments (default: 1).
347 File output moves left on the screen.
349 Scroll view to the left N increments (default: 1).
351 File output moves right on the screen.
353 Scroll view to the rightmost position.
355 Scroll view left to the start of the line.
356 .It Cm Page-down, Space, Ctrl+f, f
357 Move the selection cursor down N pages (default: 1).
358 .It Cm Page-up, Ctrl+b, b
359 Move the selection cursor up N pages (default: 1).
361 Move the selection cursor down N half pages (default: 1).
363 Move the selection cursor up N half pages (default: 1).
365 Move the selection cursor to the first line of the file.
367 Move the selection cursor to the last line of the file.
371 view for the currently selected line's commit.
375 view with the version of the file as found in the currently
376 selected line's commit.
380 view with the version of the file as found in the parent commit of the
381 currently selected line's commit.
385 view with the previously blamed commit.
387 Prompt for a search pattern and start searching for matching lines.
388 The search pattern is an extended regular expression.
389 Regular expression syntax is documented in
392 Find the Nth next line which matches the current search pattern (default: 1).
394 Find the Nth previous line which matches the current search pattern
397 Change the diff algorithm.
398 Supported diff algorithms are Myers and Patience.
399 This is a global setting which also affects the
409 Start traversing history at the specified
411 The expected argument is the name of a branch or a commit ID SHA1 hash.
412 An abbreviated hash argument will be expanded to a full SHA1 hash
413 automatically, provided the abbreviation is unique.
414 .It Fl r Ar repository-path
415 Use the repository at the specified path.
416 If not specified, assume the repository is located at or above the current
418 If this directory is a
420 work tree, use the repository path associated with this work tree.
422 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Op Ar path
423 Display the repository tree.
426 is specified, show tree entries at this path.
428 Displayed tree entries may carry one of the following trailing annotations:
429 .Bl -column YXZ description
430 .It @ Ta entry is a symbolic link
431 .It / Ta entry is a directory
432 .It * Ta entry is an executable file
433 .It $ Ta entry is a Git submodule
436 Symbolic link entries are also annotated with the target path of the link.
440 are as follows (N denotes optional prefixed count modifier):
442 .It Cm Down-arrow, j, Ctrl-n
443 Move the selection cursor down N lines (default: 1).
444 .It Cm Up-arrow, k, Ctrl-p
445 Move the selection cursor up N lines (default: 1).
446 .It Cm Page-down, Space, Ctrl+f, f
447 Move the selection cursor down N pages (default: 1).
448 .It Cm Page-up, Ctrl+b, b
449 Move the selection cursor up N pages (default: 1).
451 Move the selection cursor down N half pages (default: 1).
453 Move the selection cursor up N half pages (default: 1).
455 Move the selection cursor to the first entry.
457 Move the selection cursor to the last entry.
459 Enter the currently selected directory, or switch to the
461 view for the currently selected file.
465 view for the currently selected tree entry.
469 view listing all references in the repository.
470 This can then be used to open a new
472 view for arbitrary branches and tags.
474 Move back to the Nth parent directory (default: 1).
476 Show object IDs for all objects displayed in the
480 Prompt for a search pattern and start searching for matching tree entries.
481 The search pattern is an extended regular expression which is matched
482 against the tree entry's name.
483 Regular expression syntax is documented in
486 Find the Nth next tree entry which matches the current search pattern
489 Find the Nth previous tree entry which matches the current search pattern
498 Start traversing history at the specified
500 The expected argument is the name of a branch or a commit ID SHA1 hash.
501 An abbreviated hash argument will be expanded to a full SHA1 hash
502 automatically, provided the abbreviation is unique.
503 .It Fl r Ar repository-path
504 Use the repository at the specified path.
505 If not specified, assume the repository is located at or above the current
507 If this directory is a
509 work tree, use the repository path associated with this work tree.
511 .It Cm ref Oo Fl r Ar repository-path Oc
512 Display references in the repository.
516 are as follows (N denotes optional prefixed count modifier):
518 .It Cm Down-arrow, j, Ctrl-n
519 Move the selection cursor down N lines (default: 1).
520 .It Cm Up-arrow, k, Ctrl-p
521 Move the selection cursor up N lines (default: 1).
522 .It Cm Page-down, Space, Ctrl+f, f
523 Move the selection cursor down N pages (default: 1).
524 .It Cm Page-up, Ctrl+b, b
525 Move the selection cursor up N pages (default: 1).
527 Move the selection cursor down N half pages (default: 1).
529 Move the selection cursor up N half pages (default: 1).
531 Move the selection cursor to the first reference.
533 Move the selection cursor to the last reference.
537 view which begins traversing history at the commit resolved via the
538 currently selected reference.
542 view showing the tree resolved via the currently selected reference.
544 Show object IDs for all non-symbolic references displayed in the
548 Show last modified date of each displayed reference.
550 Toggle display order of references between sort by name and sort by timestamp.
552 Prompt for a search pattern and start searching for matching references.
553 The search pattern is an extended regular expression which is matched
554 against absolute reference names.
555 Regular expression syntax is documented in
558 Find the Nth next reference which matches the current search pattern
561 Find the Nth previous reference which matches the current search pattern
564 Reload the list of references displayed by the
573 .It Fl r Ar repository-path
574 Use the repository at the specified path.
575 If not specified, assume the repository is located at or above the current
577 If this directory is a
579 work tree, use the repository path associated with this work tree.
583 .Bl -tag -width TOG_DIFF_ALGORITHM
584 .It Ev TOG_DIFF_ALGORITHM
585 Determines the default diff algorithm used by
591 If unset, the Myers diff algorithm will be used by default.
594 shows colorized output if this variable is set to a non-empty value.
595 The default color scheme can be modified by setting the environment
596 variables documented below.
597 The colors available in color schemes are
607 which maps to the terminal's default foreground color.
608 .It Ev TOG_COLOR_DIFF_MINUS
609 The color used to mark up removed lines in diffs.
610 If not set, the default value
613 .It Ev TOG_COLOR_DIFF_PLUS
614 The color used to mark up added lines in diffs.
615 If not set, the default value
618 .It Ev TOG_COLOR_DIFF_CHUNK_HEADER
619 The color used to mark up chunk header lines in diffs.
620 If not set, the default value
623 .It Ev TOG_COLOR_DIFF_META
624 The color used to mark up meta data in diffs.
625 If not set, the default value
628 .It Ev TOG_COLOR_TREE_SUBMODULE
629 The color used to mark up submodule tree entries.
630 If not set, the default value
633 .It Ev TOG_COLOR_TREE_SYMLINK
634 The color used to mark up symbolic link tree entries.
635 If not set, the default value
638 .It Ev TOG_COLOR_TREE_DIRECTORY
639 The color used to mark up directory tree entries.
640 If not set, the default value
643 .It Ev TOG_COLOR_TREE_EXECUTABLE
644 The color used to mark up executable file tree entries.
645 If not set, the default value
648 .It Ev TOG_COLOR_COMMIT
649 The color used to mark up commit IDs.
650 If not set, the default value
653 .It Ev TOG_COLOR_AUTHOR
654 The color used to mark up author information.
655 If not set, the default value
658 .It Ev TOG_COLOR_DATE
659 The color used to mark up date information.
660 If not set, the default value
663 .It Ev TOG_COLOR_REFS_HEADS
664 The color used to mark up references in the
667 If not set, the default value
670 .It Ev TOG_COLOR_REFS_TAGS
671 The color used to mark up references in the
674 If not set, the default value
677 .It Ev TOG_COLOR_REFS_REMOTES
678 The color used to mark up references in the
681 If not set, the default value
684 .It Ev TOG_COLOR_REFS_BACKUP
685 The color used to mark up references in the
688 If not set, the default value
696 .Xr git-repository 5 ,
699 .An Stefan Sperling Aq Mt stsp@openbsd.org
700 .An Joshua Stein Aq Mt jcs@openbsd.org