tog
— Git
repository browser
tog |
command [-h ]
[arg ...] |
tog
is an interactive read-only browser
for Git repositories. This repository format is described in
git-repository(5).
tog
supports several types of views which
display repository data:
- Log view
- Displays commits in the repository's history. This view is displayed
initially if no command is specified.
- Diff view
- Displays changes made in a particular commit.
- Blame view
- Displays the line-by-line history of a file.
- Tree view
- Displays the tree corresponding to a particular commit.
tog
provides global and command-specific
key bindings and options. The global key bindings are:
Q
- Quit
tog
.
q
- Quit the view which is in focus.
Tab
- Switch focus between views.
f
- Toggle fullscreen mode for a split-screen view.
tog
will automatically use split-screen views if
the size of the terminal window is sufficiently large.
Global options must precede the command name, and are as
follows:
-h
- Display usage information.
-V
- Display program version and exit immediately.
The commands for tog
are as follows:
log
[-c
commit]
[-r
repository-path]
[path]
- Display history of a repository. If a path is
specified, show only commits which modified this path.
This command is also executed if no explicit command is
specified.
The key bindings for tog log
are as
follows:
Down-arrow,
j, >, Full stop
- Move the selection cursor down.
Up-arrow,
k, <, Comma
- Move the selection cursor up.
Page-down,
Ctrl+f
- Move the selection cursor down one page.
Page-up,
Ctrl+b
- Move the selection cursor up one page.
Enter,
Space
- Open a
diff
view showing file changes made in
the currently selected commit.
t
- Open a
tree
view showing the tree for the
currently selected commit.
Backspace
- Show log entries for the parent directory of the currently selected
path, unless an active search is in progress in which case
Backspace
aborts the search.
/
- Prompt for a search pattern and start searching for matching commits.
The search pattern is an extended regular expression which is matched
against a commit's author name, committer name, log message, and
commit ID SHA1 hash. Regular expression syntax is documented in
re_format(7).
n
- Find the next commit which matches the current search pattern.
Searching continues until either a match is found or the
Backspace
key is pressed.
N
- Find the previous commit which matches the current search pattern.
Searching continues until either a match is found or the
Backspace
key is pressed.
Ctrl+l
- Reload the log view with new commits found in the repository.
The options for tog log
are as
follows:
-c
commit
- Start traversing history at the specified
commit. The expected argument is the name of a
branch or a commit ID SHA1 hash. An abbreviated hash argument will be
expanded to a full SHA1 hash automatically, provided the abbreviation
is unique. If this option is not specified, default to the work tree's
current branch if invoked in a work tree, or to the repository's HEAD
reference.
-r
repository-path
- Use the repository at the specified path. If not specified, assume the
repository is located at or above the current working directory.
diff
[repository-path] object1
object2
- Display the differences between two objects in the repository. Each
object argument is an object ID SHA1 hash. An
abbreviated hash argument will be expanded to a full SHA1 hash
automatically, provided the abbreviation is unique. Both objects must be
of the same type (blobs, trees, or commits). If the
repository path is omitted, use the current working
directory.
The key bindings for tog diff
are as
follows:
Down-arrow,
j
- Scroll down.
Up-arrow,
k
- Scroll up.
Page-down,
Space, Ctrl+f
- Scroll down one page.
Page-up,
Ctrl+b
- Scroll up one page.
[
- Reduce the amount of diff context lines.
]
- Increase the amount of diff context lines.
<,
Comma
- If the diff view was opened via the log view, move to the previous
(younger) commit.
>,
Full stop
- If the diff view was opened via the log view, move to the next (older)
commit.
blame
[-c
commit]
[-r
repository-path]
path
- Display line-by-line history of a file at the specified path.
The key bindings for tog blame
are as
follows:
Down-arrow,
j, Page-down, Space
- Move the selection cursor down.
Up-arrow,
k, Page-up
- Move the selection cursor up.
Enter
- Open a
diff
view for the currently selected
line's commit.
b
- Reload the
blame
view with the version of the
file as found in the currently selected line's commit.
p
- Reload the
blame
view with the version of the
file as found in the parent commit of the currently selected line's
commit.
B
- Reload the
blame
view with the previously
blamed commit.
/
- Prompt for a search pattern and start searching for matching line. The
search pattern is an extended regular expression. Regular expression
syntax is documented in re_format(7).
n
- Find the next line which matches the current search pattern.
N
- Find the previous line which matches the current search pattern.
The options for tog blame
are as
follows:
-c
commit
- Start traversing history at the specified
commit. The expected argument is the name of a
branch or a commit ID SHA1 hash. An abbreviated hash argument will be
expanded to a full SHA1 hash automatically, provided the abbreviation
is unique.
-r
repository-path
- Use the repository at the specified path. If not specified, assume the
repository is located at or above the current working directory.
tree
[-c
commit]
[repository-path]
- Display the repository tree. If the repository path
is omitted, assume the repository is located in the current working
directory.
Displayed tree entries may carry one of the following trailing
annotations:
@ |
entry is a symbolic link |
/ |
entry is a directory |
* |
entry is an executable file |
$ |
entry is a Git submodule |
The key bindings for tog tree
are as
follows:
Down-arrow,
j, Page-down
- Move the selection cursor down.
Up-arrow,
k, Page-up
- Move the selection cursor up.
Enter
- Enter the currently selected directory, or switch to the
blame
view for the currently selected
file.
l
- Open a
log
view for the currently selected
tree entry.
Backspace
- Move back to the parent directory.
i
- Show object IDs for all objects displayed in the
tree
view.
/
- Prompt for a search pattern and start searching for matching tree
entries. The search pattern is an extended regular expression which is
matched against the tree entry's name. Regular expression syntax is
documented in re_format(7).
n
- Find the next tree entry which matches the current search
pattern.
N
- Find the previous tree entry which matches the current search
pattern.
The options for tog tree
are as
follows:
-c
commit
- Start traversing history at the specified
commit. The expected argument is the name of a
branch or a commit ID SHA1 hash. An abbreviated hash argument will be
expanded to a full SHA1 hash automatically, provided the abbreviation
is unique.
TOG_COLORS
tog
shows colorized output if this variable is set
to a non-empty value. The default color scheme can be modified by setting
the environment variables documented below. The colors available in color
schemes are “black”, “red”,
“green”, “yellow”, “blue”,
“megenta”, “cyan”, and “default”
which maps to the terminal's default foreground color.
TOG_COLOR_DIFF_MINUS
- The color used to mark up removed lines in diffs. If not set, the default
value “magenta” is used.
TOG_COLOR_DIFF_PLUS
- The color used to mark up added lines in diffs. If not set, the default
value “cyan” is used.
- The color used to mark up chunk header lines in diffs. If not set, the
default value “yellow” is used.
TOG_COLOR_DIFF_META
- The color used to mark up meta data in diffs. If not set, the default
value “green” is used.
TOG_COLOR_TREE_SUBMODULE
- The color used to mark up sobmodules tree entries. If not set, the default
value “magenta” is used.
TOG_COLOR_TREE_SYMLINK
- The color used to mark up symbolic link tree entries. If not set, the
default value “cyan” is used.
TOG_COLOR_TREE_DIRECTORY
- The color used to mark up directory tree entries. If not set, the default
value “blue” is used.
TOG_COLOR_TREE_EXECUTABLE
- The color used to mark up executable file tree entries. If not set, the
default value “green” is used.
TOG_COLOR_COMMIT
- The color used to mark up commit IDs. If not set, the default value
“green” is used.
TOG_COLOR_AUTHOR
- The color used to mark up author information. If not set, the default
value “cyan” is used.
TOG_COLOR_DATE
- The color used to mark up date information. If not set, the default value
“yellow” is used.
The tog
utility exits 0 on success,
and >0 if an error occurs.