TOG(1)
TOG(1) β Git repository browser π¦β¨
NAME π
tog β Git repository browser π
SYNOPSIS πΈ
tog [-hV] command [arg ...]
tog path
DESCRIPTION β¨
okay so bestie, tog is literally an interactive read-only browser for Git repositories. No cap. The 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, or if just a path is specified. π main character energy fr fr.
- Diff view β Displays work tree changes or changes made in a particular commit. It's giving "what changed tho".
- Blame view β Displays the line-by-line history of a file. πΈ
- Tree view β Displays the tree corresponding to a particular commit. π³
- Ref view β Displays references in the repository. All the refs, slay.
tog provides global and command-specific key bindings and options. Some command-specific key bindings may be prefixed with an integer, which is denoted by N in the descriptions below, and is used as a modifier to the operation as indicated. tog will echo digits to the screen when count modifiers are entered, and complete the sequence upon input of the first non-numeric character. Count modifiers can be aborted by entering an unmapped key. Once a compound command is executed, the operation can be cancelled with C-g or Backspace. π lowkey lifesaver.
Global options π
Global options must precede the command name, and are as follows:
-hβ Display usage information. π-V,--versionβ Display program version and exit immediately. periodt.
Global key bindings π
The global key bindings are:
H,F1β Display run-time help. Key bindings for the focussed view will be displayed. Pressing this again inside the help view will toggle the display of key bindings for alltogviews. β¨Qβ Quittog. Bye bestie.qβ Quit the view which is in focus. Just this view.Tabβ Switch focus between views. Tab tab tab.Fβ Toggle fullscreen mode for a split-screen view.togwill automatically use vertical split-screen views if the size of the terminal window is sufficiently large. Big screen energy.Sβ Switch the current split-screen layout, and render all active views in this new layout. The split-screen layout can be either vertical or horizontal. If the terminal is not wide enough when switching to a vertical split, views will render in fullscreen. π-β When in a split-screen view, decrease the size of the focussed splitNincrements (default:1). Shrink.+β When in a split-screen view, increase the size of the focussed splitNincrements (default:1). Grow.Gβ Go to lineNin the view (default: last line). Last line, we love to see it.gβ Go to lineNin the view (default: first line). First line, iconic.Right-arrow,lβ Scroll view to the rightNincrements (default:1). Output moves left on the screen. πLeft-arrow,hβ Scroll view to the leftNincrements (default:1). Output moves right on the screen. π$β Scroll view to the rightmost position. All the way right.0β Scroll view left to the start of the line. Back to the start.
Commands π
The commands for tog are as follows:
log π
log [-b] [-c commit] [-r repository-path] [path]
Display history of a repository. If a path is specified, show only commits which modified this path. If invoked in a work tree, the path is interpreted relative to the current working directory, and the work tree's path prefix is implicitly prepended. Otherwise, the path is interpreted relative to the repository root. fr fr.
If invoked in a work tree, the log entry of the work tree's base commit will be prefixed with one of the following annotations:
*β work tree's base commit and the base commit of all tracked files matches the branch tip~β work tree comprises mixed commits or its base commit is out-of-date
This command is also executed if no explicit command is specified.
The key bindings for tog log are as follows (N denotes optional prefixed count modifier):
Down-arrow,j,>,Full stop,Ctrl-nβ Move the selection cursor downNlines (default:1). Down down down.Up-arrow,k,<,Comma,Ctrl-pβ Move the selection cursor upNlines (default:1). Up up up.Page-down,Space,Ctrl+f,fβ Move the selection cursor downNpages (default:1). Zoom.Page-up,Ctrl+b,bβ Move the selection cursor upNpages (default:1). Zoom but up.Ctrl+d,dβ Move the selection cursor downNhalf pages (default:1). Half page, cute.Ctrl+u,uβ Move the selection cursor upNhalf pages (default:1). Half page up.Home,=β Move the cursor to the newest commit. Fresh.End,*β Move the cursor to the oldest commit. This will traverse all commits on the current branch which may take a long time depending on the number of commits in branch history. If needed, this operation can be cancelled withC-gorBackspace. β³gβ Move the cursor to commitN(default:1). Go to commit.Gβ Likegbut defaults to the oldest commit. Oldest commit, no cap.Enterβ Open a diff view showing file changes made in the currently selected commit. If a commit is marked with themkey map, open a diff view showing file changes made between the marked commit and the currently selected commit. Enter the diff.mβ Mark or unmark the selected commit. When a commit is marked, pressing the enter key on another selected commit opens a diff view showing the changes between the marked commit and the currently selected commit. Mark it.Tβ Open a tree view showing the tree for the currently selected commit. Tree time.Backspaceβ Show log entries for the parent directory of the currently selected path. However when an active search is in progress or when additional commits are loaded,Backspaceaborts the running operation. Back it up./β 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. Regular expression syntax is documented inre_format(7). Search slay.&β Prompt for a pattern and limit the log view's list of commits to those which match the pattern. If no pattern is specified, i.e. the&prompt is immediately closed with theEnterkey, then the pattern is cleared. Until the pattern is cleared, the limited list of commits replaces the full list of commits for all operations supported by the log view. For example, a search started with/will search the limited list of commits, rather than searching all commits. The pattern is an extended regular expression which is matched against a commit's author name, committer name, log message, and commit ID. Regular expression syntax is documented inre_format(7). Filter vibes.nβ Find theNth next commit which matches the current search pattern (default:1). Searching continues until either a match is found orC-gor theBackspacekey is pressed. Next match.Nβ Find theNth previous commit which matches the current search pattern (default:1). Searching continues until either a match is found orC-gor theBackspacekey is pressed. Previous match.Ctrl+lβ Reload the log view with new commits found in the repository or new work tree changes. Refresh.Bβ Reload the log view and toggle display of merged commits. The-boption determines whether merged commits are displayed initially. Merge toggle.Rβ Open a ref view listing all references in the repository. This can then be used to open a new log view for arbitrary branches and tags. Refs on refs.@β Toggle between showing the committer name and the author name. Who dis? Author or committer.
The options for tog log are as follows:
-bβ Display individual commits which were merged into the current branch from other branches. By default,tog logshows the linear history of the current branch only. TheBkey binding can be used to toggle display of merged commits at run-time. Merged commits, periodt.-c commitβ Start traversing history at the specified commit. The expected argument is a commit ID, or a reference name or keyword which will be resolved to a commit ID. An abbreviated hash argument will be expanded to a full commit ID automatically, provided the abbreviation is unique. The keywords:baseand:headresolve to the work tree's base commit and branch head, respectively. The former is only valid if invoked in a work tree, while the latter will resolve to the tip of the work tree's current branch if invoked in a work tree, otherwise it will resolve to the repository'sHEADreference. Keywords and references may be appended with:+or:-modifiers and an optional integerNto denote theNth descendant or antecedent by first parent traversal, respectively; for example,:head:-2denotes the work tree branch head's 2nd generation ancestor, and:base:+4denotes the 4th generation descendant of the work tree's base commit. Similarly,foobar:+3will denote the 3rd generation descendant of the commit resolved by the"foobar"reference. A:+or:-modifier without a trailing integer has an implicit"1"appended (e.g.,:base:+is equivalent to:base:+1). So many modifiers, but iconic.-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. If this directory is agot(1)work tree, use the repository path associated with this work tree. Repo path, got it.
β¨ COMMANDS β¨
okay bestie, this is the part where we get into the actual commands you can run with tog. It's giving main character energy for real. π
π diff π
diff [-asw] [-C number] [-c commit] [-r repository-path] [object1 object2 | path ...]
Okay so if you just run this inside a work tree with zero arguments, it shows you all the local changes in the work tree. β¨ If you pass one or more path arguments, it only shows changes inside those paths. No cap.
But wait, there's more. If you give it two object arguments, it shows the differences between those two objects in the repository. Treat each of the two arguments as a reference, a tag name, an object ID, or a keyword, and it'll show differences between the corresponding objects. Both objects must be the same type (blobs, trees, or commits). An abbreviated hash argument gets expanded to a full commit ID automatically, as long as the abbreviation is unique. π―
The keywords :base and :head resolve to the work tree's base commit and branch head, respectively. The former is only valid if you're in a work tree, while the latter resolves to the tip of the work tree's current branch if you're in a work tree, otherwise it resolves to the repository's HEAD reference. π
Keywords and references can be appended with :+ or :- modifiers and an optional integer N to denote the Nth descendant or antecedent by first parent traversal, respectively. For example, :head:-2 denotes the work tree branch head's 2nd generation ancestor, and :base:+4 denotes the 4th generation descendant of the work tree's base commit. Similarly, foobar:+3 will denote the 3rd generation descendant of the commit resolved by the "foobar" reference. A :+ or :- modifier without a trailing integer has an implicit 1 appended (e.g., :base:+ is equivalent to :base:+1). π¦
The key bindings for tog diff are as follows (N denotes optional prefixed count modifier):
aβ Toggle treatment of file contents as ASCII text even if binary data was detected.Down-arrow,j,Ctrl-nβ Scroll down N lines (default: 1).Up-arrow,k,Ctrl-pβ Scroll up N lines (default: 1).Page-down,Space,Ctrl+f,fβ Scroll down N pages (default: 1).Page-up,Ctrl+b,bβ Scroll up N pages (default: 1).Ctrl+d,dβ Scroll down N half pages (default: 1).Ctrl+u,uβ Scroll up N half pages (default: 1).Homeβ Scroll to the top of the view.Endβ Scroll to the bottom of the view.gβ Scroll to line N (default: 1).Gβ Likegbut defaults to the last line in the diff.(β Navigate to the Nth previous file in the diff (default: 1).)β Navigate to the Nth next file in the diff (default: 1).{β Navigate to the Nth previous hunk in the diff (default: 1).}β Navigate to the Nth next hunk in the diff (default: 1).[β Reduce diff context by N lines (default: 1).]β Increase diff context by N lines (default: 1).<,Comma,Kβ If the diff view was opened via the log view, move to the Nth previous (younger) commit. If the diff was opened via the blame view, move to the Nth previous line and load the corresponding commit (default: 1).>,Full stop,Jβ If the diff view was opened via the log view, move to the Nth next (older) commit. If the diff was opened via the blame view, move to the Nth next line and load the corresponding commit (default: 1).pβ Write the currently viewed diff to a patch file in/tmp. The patch pathname is drawn to the status line./β Prompt for a search pattern and start searching for matching lines. The search pattern is an extended regular expression. Regular expression syntax is documented inre_format(7).nβ Find the Nth next line which matches the current search pattern (default: 1).Nβ Find the Nth previous line which matches the current search pattern (default: 1).wβ Toggle display of whitespace-only changes.Aβ Change the diff algorithm. Supported diff algorithms are Myers (quick and dirty) and Patience (slow and tidy). This is a global setting which also affects the blame view.
The options for tog diff are as follows:
-aβ Treat file contents as ASCII text even if binary data is detected.-C numberβ Set the number of context lines shown in the diff. By default, 3 lines of context are shown.-c commitβ Show differences between commits in the repository. This option may be used up to two times. When used only once, show differences between the specified commit and its first parent commit. When used twice, show differences between the two specified commits.
The expected argument is a commit ID hash, or an existing reference, tag name, or keyword, which is resolved to a commit ID. Unique abbreviated hash arguments are automatically expanded to a full hash. Both objects must be of the same type (i.e., blobs, trees, or commits).
If the -c option is used, all non-option arguments are interpreted as paths. If one or more such path arguments are provided, only show differences for the specified paths.
-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. If this directory is agot(1)work tree, use the repository path associated with this work tree.-sβ Show changes staged withgot stageinstead of showing local changes in the work tree. This option is only valid whentog diffis invoked in a work tree with no-coptions.-wβ Ignore whitespace-only changes.
π blame π
blame [-c commit] [-r repository-path] path
Display line-by-line history of a file at the specified path. It's literally the detective work of who wrote what. π΅οΈββοΈ
The key bindings for tog blame are as follows (N denotes optional prefixed count modifier):
Down-arrow,j,Ctrl-nβ Move the selection cursor down N pages (default: 1).Up-arrow,k,Ctrl-pβ Move the selection cursor up N pages (default: 1).Page-down,Space,Ctrl+f,fβ Move the selection cursor down N pages (default: 1).Page-up,Ctrl+b,bβ Move the selection cursor up N pages (default: 1).Ctrl+d,dβ Move the selection cursor down N half pages (default: 1).Ctrl+u,uβ Move the selection cursor up N half pages (default: 1).Homeβ Move the selection cursor to the first line of the file.Endβ Move the selection cursor to the last line of the file.gβ Move the selection cursor to line N (default: 1).Gβ Likegbut defaults to the last line in the file.Enterβ Open a diff view for the currently selected line's commit.cβ 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.Cβ Reload the blame view with the previously blamed commit.Lβ Open a log view for the currently selected annotated line./β Prompt for a search pattern and start searching for matching lines. The search pattern is an extended regular expression. Regular expression syntax is documented inre_format(7).nβ Find the Nth next line which matches the current search pattern (default: 1).Nβ Find the Nth previous line which matches the current search pattern (default: 1).Aβ Change the diff algorithm. Supported diff algorithms are Myers (quick and dirty) and Patience (slow and tidy). This is a global setting which also affects the diff view.
The options for tog blame are as follows:
-c commitβ Start traversing history at the specified commit. The expected argument is a commit ID, or a reference name or keyword which will be resolved to a commit ID. An abbreviated hash argument will be expanded to a full commit ID automatically, provided the abbreviation is unique. The keywords:baseand:headresolve to the work tree's base commit and branch head, respectively. The former is only valid if invoked in a work tree, while the latter will resolve to the tip of the work tree's current branch if invoked in a work tree, otherwise it will resolve to the repository'sHEADreference. Keywords and references may be appended with:+or:-modifiers and an optional integer N to denote the Nth descendant or antecedent by first parent traversal, respectively; for example,:head:-2denotes the work tree branch head's 2nd generation ancestor, and:base:+4denotes the 4th generation descendant of the work tree's base commit. Similarly,foobar:+3will denote the 3rd generation descendant of the commit resolved by the"foobar"reference. A:+or:-modifier without a trailing integer has an implicit1appended (e.g.,:base:+is equivalent to:base:+1).-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. If this directory is agot(1)work tree, use the repository path associated with this work tree.
tree [-c commit] [-r repository-path] [path]
Okay bestie, this is the tree view π³ and it's literally giving you the whole repository tree. If you pass a path, it shows you the tree entries at that path. π
Displayed tree entries may carry one of the following trailing annotations, and you need to know them:
@β entry is a symbolic link π/β entry is a directory π*β entry is an executable file β‘$β entry is a Git submodule π¦
Symbolic link entries are also annotated with the target path of the link. No cap. π«Ά
The key bindings for tog tree are as follows (N denotes optional prefixed count modifier):
Down-arrow,j,Ctrl-nβ Move the selection cursor down N lines (default: 1). β¬οΈUp-arrow,k,Ctrl-pβ Move the selection cursor up N lines (default: 1). β¬οΈPage-down,Space,Ctrl+f,fβ Move the selection cursor down N pages (default: 1). πPage-up,Ctrl+b,bβ Move the selection cursor up N pages (default: 1). πCtrl+d,dβ Move the selection cursor down N half pages (default: 1).Ctrl+u,uβ Move the selection cursor up N half pages (default: 1).Home,=β Move the selection cursor to the first entry. πEnd,*β Move the selection cursor to the last entry. πgβ Move the selection cursor to entry N (default: 1).Gβ Likegbut defaults to the last entry.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. πRβ Open a ref view listing all references in the repository. This can then be used to open a new tree view for arbitrary branches and tags. πΏBackspaceβ Move back to the Nth parent directory (default: 1). β¬ οΈ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 inre_format(7). πnβ Find the Nth next tree entry which matches the current search pattern (default: 1). β‘οΈNβ Find the Nth previous tree entry which matches the current search pattern (default: 1). β¬ οΈ
The options for tog tree are as follows:
-c commitβ Start traversing history at the specified commit. The expected argument is a commit ID, or a reference name or keyword which will be resolved to a commit ID. An abbreviated hash argument will be expanded to a full commit ID automatically, provided the abbreviation is unique. The keywords:baseand:headresolve to the work tree's base commit and branch head, respectively. The former is only valid if invoked in a work tree, while the latter will resolve to the tip of the work tree's current branch if invoked in a work tree, otherwise it will resolve to the repository'sHEADreference. Keywords and references may be appended with:+or:-modifiers and an optional integer N to denote the Nth descendant or antecedent by first parent traversal, respectively; for example,:head:-2denotes the work tree branch head's 2nd generation ancestor, and:base:+4denotes the 4th generation descendant of the work tree's base commit. Similarly,foobar:+3will denote the 3rd generation descendant of the commit resolved by the"foobar"reference. A:+or:-modifier without a trailing integer has an implicit"1"appended (e.g.,:base:+is equivalent to:base:+1). π₯-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. If this directory is agot(1)work tree, use the repository path associated with this work tree. π
ref [-r repository-path]
Display references in the repository. β¨
The key bindings for tog ref are as follows (N denotes optional prefixed count modifier):
Down-arrow,j,Ctrl-nβ Move the selection cursor down N lines (default: 1). β¬οΈUp-arrow,k,Ctrl-pβ Move the selection cursor up N lines (default: 1). β¬οΈPage-down,Space,Ctrl+f,fβ Move the selection cursor down N pages (default: 1). πPage-up,Ctrl+b,bβ Move the selection cursor up N pages (default: 1). πCtrl+d,dβ Move the selection cursor down N half pages (default: 1).Ctrl+u,uβ Move the selection cursor up N half pages (default: 1).Home,=β Move the selection cursor to the first reference. πEnd,*β Move the selection cursor to the last reference. πgβ Move the selection cursor to reference N (default: 1).Gβ Likegbut defaults to the last reference.Enterβ Open a log view which begins traversing history at the commit resolved via the currently selected reference. πTβ Open a tree view showing the tree resolved via the currently selected reference. π³iβ Show object IDs for all non-symbolic references displayed in the ref view. πmβ Show last modified date of each displayed reference. πoβ Toggle display order of references between sort by name and sort by timestamp. π/β Prompt for a search pattern and start searching for matching references. The search pattern is an extended regular expression which is matched against absolute reference names. Regular expression syntax is documented inre_format(7). πnβ Find the Nth next reference which matches the current search pattern (default: 1). β‘οΈNβ Find the Nth previous reference which matches the current search pattern (default: 1). β¬ οΈCtrl+lβ Reload the list of references displayed by the ref view. π
The options for tog ref are as follows:
-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. If this directory is agot(1)work tree, use the repository path associated with this work tree. π
π ENVIRONMENT π
okay bestie listen up, this is the part where you make tog look exactly how you want it to look, and honestly? iconic behavior π
TOG_COLORSβ set this bad boy to literally any non-empty value andtogwill show you colorized output. obsessed. and you can remix the whole default color scheme by setting the environment variables we're about to document below π the colors you can use in color schemes areblack,red,green,yellow,blue,magenta,cyan, anddefaultβ and that last one maps to your terminal's default foreground color, no cap π
TOG_COLOR_AUTHORβ the color used to mark up author information. if you don't set it, the default valuecyanis used β¨TOG_COLOR_COMMITβ the color used to mark up commit IDs. if you don't set it, the default valuegreenis used πTOG_COLOR_DATEβ the color used to mark up date information. if you don't set it, the default valueyellowis used πTOG_COLOR_DIFF_CHUNK_HEADERβ the color used to mark up chunk header lines in diffs. if you don't set it, the default valueyellowis used πTOG_COLOR_DIFF_METAβ the color used to mark up meta data in diffs. if you don't set it, the default valuegreenis used πΏTOG_COLOR_DIFF_MINUSβ the color used to mark up removed lines in diffs. if you don't set it, the default valuemagentais used πTOG_COLOR_DIFF_PLUSβ the color used to mark up added lines in diffs. if you don't set it, the default valuecyanis used π©΅TOG_COLOR_REFS_BACKUPβ the color used to mark up references in therefs/got/backup/namespace. if you don't set it, the default valuecyanis used πTOG_COLOR_REFS_HEADSβ the color used to mark up references in therefs/heads/namespace. if you don't set it, the default valuegreenis used π±TOG_COLOR_REFS_REMOTESβ the color used to mark up references in therefs/remotes/namespace. if you don't set it, the default valueyellowis used βοΈTOG_COLOR_REFS_TAGSβ the color used to mark up references in therefs/tags/namespace. if you don't set it, the default valuemagentais used π·οΈTOG_COLOR_TREE_DIRECTORYβ the color used to mark up directory tree entries. if you don't set it, the default valuecyanis used πTOG_COLOR_TREE_EXECUTABLEβ the color used to mark up executable file tree entries. if you don't set it, the default valuegreenis used β‘TOG_COLOR_TREE_SUBMODULEβ the color used to mark up submodule tree entries. if you don't set it, the default valuemagentais used π§©TOG_COLOR_TREE_SYMLINKβ the color used to mark up symbolic link tree entries. if you don't set it, the default valuemagentais used π
TOG_DIFF_ALGORITHMβ this one decides the default diff algorithm thattoguses. the supported diff algorithms are Myers (quick and dirty) and Patience (slow and tidy). valid values forTOG_DIFF_ALGORITHMarepatienceandmyers. if it's unset, the Patience diff algorithm will be used by default. so yeah, default vibe is slow and tidy, bestie π¦TOG_VIEW_SPLIT_MODEβ decides the default layout of your split-screen views. if you set it tohorH,togwill use horizontal split by default. otherwise, vertical split will be used. and theSkey can be used to switch between vertical and horizontal split layout at run-time β live, mid-session, no restart needed π₯
πͺ EXIT STATUS πͺ
the tog utility exits 0 on success, and >0 if an error occurs. so if it's zero we're thriving, if it's bigger than zero... something said no π
π SEE ALSO π
go read those too, they're all part of the lore, iykyk π
π AUTHORS π
these are the legends who made tog happen, show some respect π
- Christian Weisgerber
<naddy@openbsd.org> - Josh Rickmar
<jrick@zettaport.com> - Joshua Stein
<jcs@openbsd.org> - Mark Jamsek
<mark@jamsek.dev> - Martin Pieuchot
<mpi@openbsd.org> - Omar Polo
<op@openbsd.org> - Stefan Sperling
<stsp@openbsd.org> - Klemens Nanni
<kn@openbsd.org>
and that's the whole page, bestie π this one's the Debian build, riding with a $Mdocdate$ date stamp, filed under TOG(1). go read your history, stay colorful, and slay π
β¨π¦
π¦ where this page comes from
- alpine 3.24: got-doc 0.126-r0 Β· ISC
- debian trixie: got 0.111-1 Β· ISC
- nixos 26.05: got 0.125
- nixpkgs unstable: got 0.129
- ubuntu questing: got 0.111-1
- ubuntu resolute: got 0.119-1 Β· ISC
- ubuntu stonking: got 0.126-1build1 Β· ISC
- Copyright (c) 2018 Stefan Sperling
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms