<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.dtd">

<sect2 lang="en" id="gitk(1)">
    <title>gitk(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>gitk(1)</primary>
</indexterm>
<simplesect id="gitk(1)__name">
<title>NAME</title>
<simpara>gitk - The Git repository browser</simpara>
</simplesect>
<simplesect id="gitk(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>gitk</emphasis> [&lt;options&gt;] [&lt;revision-range&gt;] [--] [&lt;path&gt;&#8230;]</literallayout>
</blockquote>
</simplesect>
<simplesect id="gitk(1)__description">
<title>DESCRIPTION</title>
<simpara>Displays changes in a repository or a selected set of commits. This includes
visualizing the commit graph, showing information related to each commit, and
the files in the trees of each revision.</simpara>
</simplesect>
<simplesect id="gitk(1)__options">
<title>OPTIONS</title>
<simpara>To control which revisions to show, gitk supports most options
applicable to the <emphasis>git rev-list</emphasis> command.  It also supports a few
options applicable to the <emphasis>git diff-*</emphasis> commands to control how the
changes each commit introduces are shown.  Finally, it supports some
gitk-specific options.</simpara>
<simpara>gitk generally only understands options with arguments in the
<emphasis>stuck</emphasis> form (see <xref linkend="gitcli(7)" />) due to limitations in the
command-line parser.</simpara>
<section id="gitk(1)__rev_list_options_and_arguments">
<title>rev-list options and arguments</title>
<simpara>This manual page describes only the most frequently used options.  See
<xref linkend="git-rev-list(1)" /> for a complete list.</simpara>
<variablelist>
<varlistentry>
<term>
--all
</term>
<listitem>
<simpara>
        Show all refs (branches, tags, etc.).
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--branches[=&lt;pattern&gt;]
</term>
<term>
--tags[=&lt;pattern&gt;]
</term>
<term>
--remotes[=&lt;pattern&gt;]
</term>
<listitem>
<simpara>
        Pretend as if all the branches (tags, remote branches, resp.)
        are listed on the command line as <emphasis>&lt;commit&gt;</emphasis>. If <emphasis>&lt;pattern&gt;</emphasis>
        is given, limit refs to ones matching given shell glob. If
        pattern lacks <emphasis>?</emphasis>, <emphasis>&#42;</emphasis>, or <emphasis>[</emphasis>, <emphasis>/&#42;</emphasis> at the
        end is implied.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--since=&lt;date&gt;
</term>
<listitem>
<simpara>
        Show commits more recent than a specific date.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--until=&lt;date&gt;
</term>
<listitem>
<simpara>
        Show commits older than a specific date.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--date-order
</term>
<listitem>
<simpara>
        Sort commits by date when possible.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--merge
</term>
<listitem>
<simpara>
        After an attempt to merge stops with conflicts, show the commits on
        the history between two branches (i.e. the HEAD and the MERGE_HEAD)
        that modify the conflicted files and do not exist on all the heads
        being merged.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--left-right
</term>
<listitem>
<simpara>
        Mark which side of a symmetric difference a commit is reachable
        from.  Commits from the left side are prefixed with a <emphasis>&lt;</emphasis>
        symbol and those from the right with a <emphasis>&gt;</emphasis> symbol.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--full-history
</term>
<listitem>
<simpara>
        When filtering history with <emphasis>&lt;path&gt;&#8230;</emphasis>, does not prune some
        history.  (See "History simplification" in <xref linkend="git-log(1)" />
        for a more detailed explanation.)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--simplify-merges
</term>
<listitem>
<simpara>
        Additional option to <emphasis>--full-history</emphasis> to remove some needless
        merges from the resulting history, as there are no selected
        commits contributing to this merge.  (See "History
        simplification" in <xref linkend="git-log(1)" /> for a more detailed
        explanation.)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--ancestry-path
</term>
<listitem>
<simpara>
        When given a range of commits to display
        (e.g. <emphasis>commit1..commit2</emphasis> or <emphasis>commit2 &#94;commit1</emphasis>), only
        display commits that exist directly on the ancestry chain
        between the <emphasis>commit1</emphasis> and <emphasis>commit2</emphasis>, i.e. commits that are
        both descendants of <emphasis>commit1</emphasis>, and ancestors of <emphasis>commit2</emphasis>.
        (See "History simplification" in <xref linkend="git-log(1)" /> for a more
        detailed explanation.)
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
-L&lt;start&gt;,&lt;end&gt;:&lt;file&gt;
</term>
<term>
-L:&lt;funcname&gt;:&lt;file&gt;
</term>
<listitem>
<simpara>
        Trace the evolution of the line range given by <emphasis>&lt;start&gt;,&lt;end&gt;</emphasis>,
        or by the function name regex <emphasis>&lt;funcname&gt;</emphasis>, within the <emphasis>&lt;file&gt;</emphasis>. You may
        not give any pathspec limiters.  This is currently limited to
        a walk starting from a single revision, i.e., you may only
        give zero or one positive revision arguments, and
        <emphasis>&lt;start&gt;</emphasis> and <emphasis>&lt;end&gt;</emphasis> (or <emphasis>&lt;funcname&gt;</emphasis>) must exist in the starting revision.
        You can specify this option more than once. Implies <emphasis>--patch</emphasis>.
        Patch output can be suppressed using <emphasis>--no-patch</emphasis>, but other diff formats
        (namely <emphasis>--raw</emphasis>, <emphasis>--numstat</emphasis>, <emphasis>--shortstat</emphasis>, <emphasis>--dirstat</emphasis>, <emphasis>--summary</emphasis>,
        <emphasis>--name-only</emphasis>, <emphasis>--name-status</emphasis>, <emphasis>--check</emphasis>) are not currently implemented.
</simpara>
<simpara><emphasis>&lt;start&gt;</emphasis> and <emphasis>&lt;end&gt;</emphasis> can take one of these forms:</simpara>
<itemizedlist>
<listitem>
<simpara>
number
</simpara>
<simpara>If <emphasis>&lt;start&gt;</emphasis> or <emphasis>&lt;end&gt;</emphasis> is a number, it specifies an
absolute line number (lines count from 1).</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>/regex/</emphasis>
</simpara>
<simpara>This form will use the first line matching the given
POSIX regex. If <emphasis>&lt;start&gt;</emphasis> is a regex, it will search from the end of
the previous <emphasis>-L</emphasis> range, if any, otherwise from the start of file.
If <emphasis>&lt;start&gt;</emphasis> is <emphasis>^/regex/</emphasis>, it will search from the start of file.
If <emphasis>&lt;end&gt;</emphasis> is a regex, it will search
starting at the line given by <emphasis>&lt;start&gt;</emphasis>.</simpara>
</listitem>
<listitem>
<simpara>
+offset or -offset
</simpara>
<simpara>This is only valid for <emphasis>&lt;end&gt;</emphasis> and will specify a number
of lines before or after the line given by <emphasis>&lt;start&gt;</emphasis>.</simpara>
</listitem>
</itemizedlist>
<simpara>If <emphasis>:&lt;funcname&gt;</emphasis> is given in place of <emphasis>&lt;start&gt;</emphasis> and <emphasis>&lt;end&gt;</emphasis>, it is a
regular expression that denotes the range from the first funcname line
that matches <emphasis>&lt;funcname&gt;</emphasis>, up to the next funcname line. <emphasis>:&lt;funcname&gt;</emphasis>
searches from the end of the previous <emphasis>-L</emphasis> range, if any, otherwise
from the start of file. <emphasis>^:&lt;funcname&gt;</emphasis> searches from the start of
file. The function names are determined in the same way as <emphasis>git diff</emphasis>
works out patch hunk headers (see <emphasis>Defining a custom hunk-header</emphasis>
in <xref linkend="gitattributes(5)" />).</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
&lt;revision range&gt;
</term>
<listitem>
<simpara>
        Limit the revisions to show. This can be either a single revision
        meaning show from the given revision and back, or it can be a range in
        the form "<emphasis>&lt;from&gt;</emphasis>..<emphasis>&lt;to&gt;</emphasis>" to show all revisions between <emphasis>&lt;from&gt;</emphasis> and
        back to <emphasis>&lt;to&gt;</emphasis>. Note, more advanced revision selection can be applied.
        For a more complete list of ways to spell object names, see
        <xref linkend="gitrevisions(7)" />.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
&lt;path&gt;&#8230;
</term>
<listitem>
<simpara>
        Limit commits to the ones touching files in the given paths. Note, to
        avoid ambiguity with respect to revision names use "--" to separate the paths
        from any preceding options.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<section id="gitk(1)__gitk_specific_options">
<title>gitk-specific options</title>
<variablelist>
<varlistentry>
<term>
--argscmd=&lt;command&gt;
</term>
<listitem>
<simpara>
        Command to be run each time gitk has to determine the revision
        range to show.  The command is expected to print on its
        standard output a list of additional revisions to be shown,
        one per line.  Use this instead of explicitly specifying a
        <emphasis>&lt;revision-range&gt;</emphasis> if the set of commits to show may vary
        between refreshes.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--select-commit=&lt;ref&gt;
</term>
<listitem>
<simpara>
        Select the specified commit after loading the graph.
        Default behavior is equivalent to specifying <emphasis>--select-commit=HEAD</emphasis>.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
</simplesect>
<simplesect id="gitk(1)__examples">
<title>Examples</title>
<variablelist>
<varlistentry>
<term>
gitk v2.6.12.. include/scsi drivers/scsi
</term>
<listitem>
<simpara>
        Show the changes since version <emphasis>v2.6.12</emphasis> that changed any
        file in the include/scsi or drivers/scsi subdirectories
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
gitk --since="2 weeks ago" -- gitk
</term>
<listitem>
<simpara>
        Show the changes during the last two weeks to the file <emphasis>gitk</emphasis>.
        The "--" is necessary to avoid confusion with the <emphasis role="strong">branch</emphasis> named
        <emphasis>gitk</emphasis>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
gitk --max-count=100 --all -- Makefile
</term>
<listitem>
<simpara>
        Show at most 100 changes made to the file <emphasis>Makefile</emphasis>. Instead of only
        looking for changes in the current branch look in all branches.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="gitk(1)__files">
<title>Files</title>
<simpara>User configuration and preferences are stored at:</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>$XDG_CONFIG_HOME/git/gitk</emphasis> if it exists, otherwise
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>$HOME/.gitk</emphasis> if it exists
</simpara>
</listitem>
</itemizedlist>
<simpara>If neither of the above exist then <emphasis>$XDG_CONFIG_HOME/git/gitk</emphasis> is created and
used by default. If <emphasis>$XDG_CONFIG_HOME</emphasis> is not set it defaults to
<emphasis>$HOME/.config</emphasis> in all cases.</simpara>
</simplesect>
<simplesect id="gitk(1)__history">
<title>History</title>
<simpara>Gitk was the first graphical repository browser. It's written in
tcl/tk.</simpara>
<simpara><emphasis>gitk</emphasis> is actually maintained as an independent project, but stable
versions are distributed as part of the Git suite for the convenience
of end users.</simpara>
<simpara>gitk-git/ comes from Paul Mackerras's gitk project:</simpara>
<literallayout class="monospaced">git://ozlabs.org/~paulus/gitk</literallayout>
</simplesect>
<simplesect id="gitk(1)__see_also">
<title>SEE ALSO</title>
<variablelist>
<varlistentry>
<term>
<emphasis>qgit(1)</emphasis>
</term>
<listitem>
<simpara>
        A repository browser written in C++ using Qt.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<emphasis>tig(1)</emphasis>
</term>
<listitem>
<simpara>
        A minimal repository browser and Git tool output highlighter written
        in C using Ncurses.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="gitk(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
