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

<sect2 lang="en" id="git-maintenance(1)">
    <title>git-maintenance(1)</title>
    <date>2024-07-02</date>
<revhistory><revision><date>2024-07-02</date></revision></revhistory>
<indexterm>
<primary>git-maintenance(1)</primary>
</indexterm>
<simplesect id="git-maintenance(1)__name">
<title>NAME</title>
<simpara>git-maintenance - Run tasks to optimize Git repository data</simpara>
</simplesect>
<simplesect id="git-maintenance(1)__synopsis">
<title>SYNOPSIS</title>
<blockquote>
<literallayout><emphasis>git maintenance</emphasis> run [&lt;options&gt;]
<emphasis>git maintenance</emphasis> start [--scheduler=&lt;scheduler&gt;]
<emphasis>git maintenance</emphasis> (stop|register|unregister) [&lt;options&gt;]</literallayout>
</blockquote>
</simplesect>
<simplesect id="git-maintenance(1)__description">
<title>DESCRIPTION</title>
<simpara>Run tasks to optimize Git repository data, speeding up other Git commands
and reducing storage requirements for the repository.</simpara>
<simpara>Git commands that add repository data, such as <emphasis>git add</emphasis> or <emphasis>git fetch</emphasis>,
are optimized for a responsive user experience. These commands do not take
time to optimize the Git data, since such optimizations scale with the full
size of the repository while these user commands each perform a relatively
small action.</simpara>
<simpara>The <emphasis>git maintenance</emphasis> command provides flexibility for how to optimize the
Git repository.</simpara>
</simplesect>
<simplesect id="git-maintenance(1)__subcommands">
<title>SUBCOMMANDS</title>
<variablelist>
<varlistentry>
<term>
run
</term>
<listitem>
<simpara>
        Run one or more maintenance tasks. If one or more <emphasis>--task</emphasis> options
        are specified, then those tasks are run in that order. Otherwise,
        the tasks are determined by which <emphasis>maintenance.&lt;task&gt;.enabled</emphasis>
        config options are true. By default, only <emphasis>maintenance.gc.enabled</emphasis>
        is true.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
start
</term>
<listitem>
<simpara>
        Start running maintenance on the current repository. This performs
        the same config updates as the <emphasis>register</emphasis> subcommand, then updates
        the background scheduler to run <emphasis>git maintenance run --scheduled</emphasis>
        on an hourly basis.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
stop
</term>
<listitem>
<simpara>
        Halt the background maintenance schedule. The current repository
        is not removed from the list of maintained repositories, in case
        the background maintenance is restarted later.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
register
</term>
<listitem>
<simpara>
        Initialize Git config values so any scheduled maintenance will start
        running on this repository. This adds the repository to the
        <emphasis>maintenance.repo</emphasis> config variable in the current user's global config,
        or the config specified by --config-file option, and enables some
        recommended configuration values for <emphasis>maintenance.&lt;task&gt;.schedule</emphasis>. The
        tasks that are enabled are safe for running in the background without
        disrupting foreground processes.
</simpara>
<simpara>The <emphasis>register</emphasis> subcommand will also set the <emphasis>maintenance.strategy</emphasis> config
value to <emphasis>incremental</emphasis>, if this value is not previously set. The
<emphasis>incremental</emphasis> strategy uses the following schedule for each maintenance
task:</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>gc</emphasis>: disabled.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>commit-graph</emphasis>: hourly.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>prefetch</emphasis>: hourly.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>loose-objects</emphasis>: daily.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>incremental-repack</emphasis>: daily.
</simpara>
</listitem>
</itemizedlist>
<simpara><emphasis>git maintenance register</emphasis> will also disable foreground maintenance by
setting <emphasis>maintenance.auto = false</emphasis> in the current repository. This config
setting will remain after a <emphasis>git maintenance unregister</emphasis> command.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
unregister
</term>
<listitem>
<simpara>
        Remove the current repository from background maintenance. This
        only removes the repository from the configured list. It does not
        stop the background maintenance processes from running.
</simpara>
<simpara>The <emphasis>unregister</emphasis> subcommand will report an error if the current repository
is not already registered. Use the <emphasis>--force</emphasis> option to return success even
when the current repository is not registered.</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-maintenance(1)__tasks">
<title>TASKS</title>
<variablelist>
<varlistentry>
<term>
commit-graph
</term>
<listitem>
<simpara>
        The <emphasis>commit-graph</emphasis> job updates the <emphasis>commit-graph</emphasis> files incrementally,
        then verifies that the written data is correct. The incremental
        write is safe to run alongside concurrent Git processes since it
        will not expire <emphasis>.graph</emphasis> files that were in the previous
        <emphasis>commit-graph-chain</emphasis> file. They will be deleted by a later run based
        on the expiration delay.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
prefetch
</term>
<listitem>
<simpara>
        The <emphasis>prefetch</emphasis> task updates the object directory with the latest
        objects from all registered remotes. For each remote, a <emphasis>git fetch</emphasis>
        command is run. The configured refspec is modified to place all
        requested refs within <emphasis>refs/prefetch/</emphasis>. Also, tags are not updated.
</simpara>
<simpara>This is done to avoid disrupting the remote-tracking branches. The end users
expect these refs to stay unmoved unless they initiate a fetch.  However,
with the prefetch task, the objects necessary to complete a later real fetch
would already be obtained, making the real fetch faster.  In the ideal case,
it will just become an update to a bunch of remote-tracking branches without
any object transfer.</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
gc
</term>
<listitem>
<simpara>
        Clean up unnecessary files and optimize the local repository. "GC"
        stands for "garbage collection," but this task performs many
        smaller tasks. This task can be expensive for large repositories,
        as it repacks all Git objects into a single pack-file. It can also
        be disruptive in some situations, as it deletes stale data. See
        <xref linkend="git-gc(1)" /> for more details on garbage collection in Git.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
loose-objects
</term>
<listitem>
<simpara>
        The <emphasis>loose-objects</emphasis> job cleans up loose objects and places them into
        pack-files. In order to prevent race conditions with concurrent Git
        commands, it follows a two-step process. First, it deletes any loose
        objects that already exist in a pack-file; concurrent Git processes
        will examine the pack-file for the object data instead of the loose
        object. Second, it creates a new pack-file (starting with "loose-")
        containing a batch of loose objects. The batch size is limited to 50
        thousand objects to prevent the job from taking too long on a
        repository with many loose objects. The <emphasis>gc</emphasis> task writes unreachable
        objects as loose objects to be cleaned up by a later step only if
        they are not re-added to a pack-file; for this reason it is not
        advisable to enable both the <emphasis>loose-objects</emphasis> and <emphasis>gc</emphasis> tasks at the
        same time.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
incremental-repack
</term>
<listitem>
<simpara>
        The <emphasis>incremental-repack</emphasis> job repacks the object directory
        using the <emphasis>multi-pack-index</emphasis> feature. In order to prevent race
        conditions with concurrent Git commands, it follows a two-step
        process. First, it calls <emphasis>git multi-pack-index expire</emphasis> to delete
        pack-files unreferenced by the <emphasis>multi-pack-index</emphasis> file. Second, it
        calls <emphasis>git multi-pack-index repack</emphasis> to select several small
        pack-files and repack them into a bigger one, and then update the
        <emphasis>multi-pack-index</emphasis> entries that refer to the small pack-files to
        refer to the new pack-file. This prepares those small pack-files
        for deletion upon the next run of <emphasis>git multi-pack-index expire</emphasis>.
        The selection of the small pack-files is such that the expected
        size of the big pack-file is at least the batch size; see the
        <emphasis>--batch-size</emphasis> option for the <emphasis>repack</emphasis> subcommand in
        <xref linkend="git-multi-pack-index(1)" />. The default batch-size is zero,
        which is a special case that attempts to repack all pack-files
        into a single pack-file.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
pack-refs
</term>
<listitem>
<simpara>
        The <emphasis>pack-refs</emphasis> task collects the loose reference files and
        collects them into a single file. This speeds up operations that
        need to iterate across many references. See <xref linkend="git-pack-refs(1)" />
        for more information.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-maintenance(1)__options">
<title>OPTIONS</title>
<variablelist>
<varlistentry>
<term>
--auto
</term>
<listitem>
<simpara>
        When combined with the <emphasis>run</emphasis> subcommand, run maintenance tasks
        only if certain thresholds are met. For example, the <emphasis>gc</emphasis> task
        runs when the number of loose objects exceeds the number stored
        in the <emphasis>gc.auto</emphasis> config setting, or when the number of pack-files
        exceeds the <emphasis>gc.autoPackLimit</emphasis> config setting. Not compatible with
        the <emphasis>--schedule</emphasis> option.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--schedule
</term>
<listitem>
<simpara>
        When combined with the <emphasis>run</emphasis> subcommand, run maintenance tasks
        only if certain time conditions are met, as specified by the
        <emphasis>maintenance.&lt;task&gt;.schedule</emphasis> config value for each <emphasis>&lt;task&gt;</emphasis>.
        This config value specifies a number of seconds since the last
        time that task ran, according to the <emphasis>maintenance.&lt;task&gt;.lastRun</emphasis>
        config value. The tasks that are tested are those provided by
        the <emphasis>--task=&lt;task&gt;</emphasis> option(s) or those with
        <emphasis>maintenance.&lt;task&gt;.enabled</emphasis> set to true.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--quiet
</term>
<listitem>
<simpara>
        Do not report progress or other information over <emphasis>stderr</emphasis>.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--task=&lt;task&gt;
</term>
<listitem>
<simpara>
        If this option is specified one or more times, then only run the
        specified tasks in the specified order. If no <emphasis>--task=&lt;task&gt;</emphasis>
        arguments are specified, then only the tasks with
        <emphasis>maintenance.&lt;task&gt;.enabled</emphasis> configured as <emphasis>true</emphasis> are considered.
        See the <emphasis>TASKS</emphasis> section for the list of accepted <emphasis>&lt;task&gt;</emphasis> values.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
--scheduler=auto|crontab|systemd-timer|launchctl|schtasks
</term>
<listitem>
<simpara>
        When combined with the <emphasis>start</emphasis> subcommand, specify the scheduler
        for running the hourly, daily and weekly executions of
        <emphasis>git maintenance run</emphasis>.
        Possible values for <emphasis>&lt;scheduler&gt;</emphasis> are <emphasis>auto</emphasis>, <emphasis>crontab</emphasis>
        (POSIX), <emphasis>systemd-timer</emphasis> (Linux), <emphasis>launchctl</emphasis> (macOS), and
        <emphasis>schtasks</emphasis> (Windows). When <emphasis>auto</emphasis> is specified, the
        appropriate platform-specific scheduler is used; on Linux,
        <emphasis>systemd-timer</emphasis> is used if available, otherwise
        <emphasis>crontab</emphasis>. Default is <emphasis>auto</emphasis>.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-maintenance(1)__troubleshooting">
<title>TROUBLESHOOTING</title>
<simpara>The <emphasis>git maintenance</emphasis> command is designed to simplify the repository
maintenance patterns while minimizing user wait time during Git commands.
A variety of configuration options are available to allow customizing this
process. The default maintenance options focus on operations that complete
quickly, even on large repositories.</simpara>
<simpara>Users may find some cases where scheduled maintenance tasks do not run as
frequently as intended. Each <emphasis>git maintenance run</emphasis> command takes a lock on
the repository's object database, and this prevents other concurrent
<emphasis>git maintenance run</emphasis> commands from running on the same repository. Without
this safeguard, competing processes could leave the repository in an
unpredictable state.</simpara>
<simpara>The background maintenance schedule runs <emphasis>git maintenance run</emphasis> processes
on an hourly basis. Each run executes the "hourly" tasks. At midnight,
that process also executes the "daily" tasks. At midnight on the first day
of the week, that process also executes the "weekly" tasks. A single
process iterates over each registered repository, performing the scheduled
tasks for that frequency. Depending on the number of registered
repositories and their sizes, this process may take longer than an hour.
In this case, multiple <emphasis>git maintenance run</emphasis> commands may run on the same
repository at the same time, colliding on the object database lock. This
results in one of the two tasks not running.</simpara>
<simpara>If you find that some maintenance windows are taking longer than one hour
to complete, then consider reducing the complexity of your maintenance
tasks. For example, the <emphasis>gc</emphasis> task is much slower than the
<emphasis>incremental-repack</emphasis> task. However, this comes at a cost of a slightly
larger object database. Consider moving more expensive tasks to be run
less frequently.</simpara>
<simpara>Expert users may consider scheduling their own maintenance tasks using a
different schedule than is available through <emphasis>git maintenance start</emphasis> and
Git configuration options. These users should be aware of the object
database lock and how concurrent <emphasis>git maintenance run</emphasis> commands behave.
Further, the <emphasis>git gc</emphasis> command should not be combined with
<emphasis>git maintenance run</emphasis> commands. <emphasis>git gc</emphasis> modifies the object database
but does not take the lock in the same way as <emphasis>git maintenance run</emphasis>. If
possible, use <emphasis>git maintenance run --task=gc</emphasis> instead of <emphasis>git gc</emphasis>.</simpara>
<simpara>The following sections describe the mechanisms put in place to run
background maintenance by <emphasis>git maintenance start</emphasis> and how to customize
them.</simpara>
</simplesect>
<simplesect id="git-maintenance(1)__background_maintenance_on_posix_systems">
<title>BACKGROUND MAINTENANCE ON POSIX SYSTEMS</title>
<simpara>The standard mechanism for scheduling background tasks on POSIX systems
is cron(8). This tool executes commands based on a given schedule. The
current list of user-scheduled tasks can be found by running <emphasis>crontab -l</emphasis>.
The schedule written by <emphasis>git maintenance start</emphasis> is similar to this:</simpara>
<screen># BEGIN GIT MAINTENANCE SCHEDULE
# The following schedule was created by Git
# Any edits made in this region might be
# replaced in the future by a Git command.

0 1-23 * * * "/&lt;path&gt;/git" --exec-path="/&lt;path&gt;" for-each-repo --config=maintenance.repo maintenance run --schedule=hourly
0 0 * * 1-6 "/&lt;path&gt;/git" --exec-path="/&lt;path&gt;" for-each-repo --config=maintenance.repo maintenance run --schedule=daily
0 0 * * 0 "/&lt;path&gt;/git" --exec-path="/&lt;path&gt;" for-each-repo --config=maintenance.repo maintenance run --schedule=weekly

# END GIT MAINTENANCE SCHEDULE</screen>
<simpara>The comments are used as a region to mark the schedule as written by Git.
Any modifications within this region will be completely deleted by
<emphasis>git maintenance stop</emphasis> or overwritten by <emphasis>git maintenance start</emphasis>.</simpara>
<simpara>The <emphasis>crontab</emphasis> entry specifies the full path of the <emphasis>git</emphasis> executable to
ensure that the executed <emphasis>git</emphasis> command is the same one with which
<emphasis>git maintenance start</emphasis> was issued independent of <emphasis>PATH</emphasis>. If the same user
runs <emphasis>git maintenance start</emphasis> with multiple Git executables, then only the
latest executable is used.</simpara>
<simpara>These commands use <emphasis>git for-each-repo --config=maintenance.repo</emphasis> to run
<emphasis>git maintenance run --schedule=&lt;frequency&gt;</emphasis> on each repository listed in
the multi-valued <emphasis>maintenance.repo</emphasis> config option. These are typically
loaded from the user-specific global config. The <emphasis>git maintenance</emphasis> process
then determines which maintenance tasks are configured to run on each
repository with each <emphasis>&lt;frequency&gt;</emphasis> using the <emphasis>maintenance.&lt;task&gt;.schedule</emphasis>
config options. These values are loaded from the global or repository
config values.</simpara>
<simpara>If the config values are insufficient to achieve your desired background
maintenance schedule, then you can create your own schedule. If you run
<emphasis>crontab -e</emphasis>, then an editor will load with your user-specific <emphasis>cron</emphasis>
schedule. In that editor, you can add your own schedule lines. You could
start by adapting the default schedule listed earlier, or you could read
the crontab(5) documentation for advanced scheduling techniques. Please
do use the full path and <emphasis>--exec-path</emphasis> techniques from the default
schedule to ensure you are executing the correct binaries in your
schedule.</simpara>
</simplesect>
<simplesect id="git-maintenance(1)__background_maintenance_on_linux_systemd_systems">
<title>BACKGROUND MAINTENANCE ON LINUX SYSTEMD SYSTEMS</title>
<simpara>While Linux supports <emphasis>cron</emphasis>, depending on the distribution, <emphasis>cron</emphasis> may
be an optional package not necessarily installed. On modern Linux
distributions, systemd timers are superseding it.</simpara>
<simpara>If user systemd timers are available, they will be used as a replacement
of <emphasis>cron</emphasis>.</simpara>
<simpara>In this case, <emphasis>git maintenance start</emphasis> will create user systemd timer units
and start the timers. The current list of user-scheduled tasks can be found
by running <emphasis>systemctl --user list-timers</emphasis>. The timers written by <emphasis>git
maintenance start</emphasis> are similar to this:</simpara>
<screen>$ systemctl --user list-timers
NEXT                         LEFT          LAST                         PASSED     UNIT                         ACTIVATES
Thu 2021-04-29 19:00:00 CEST 42min left    Thu 2021-04-29 18:00:11 CEST 17min ago  git-maintenance@hourly.timer git-maintenance@hourly.service
Fri 2021-04-30 00:00:00 CEST 5h 42min left Thu 2021-04-29 00:00:11 CEST 18h ago    git-maintenance@daily.timer  git-maintenance@daily.service
Mon 2021-05-03 00:00:00 CEST 3 days left   Mon 2021-04-26 00:00:11 CEST 3 days ago git-maintenance@weekly.timer git-maintenance@weekly.service</screen>
<simpara>One timer is registered for each <emphasis>--schedule=&lt;frequency&gt;</emphasis> option.</simpara>
<simpara>The definition of the systemd units can be inspected in the following files:</simpara>
<screen>~/.config/systemd/user/git-maintenance@.timer
~/.config/systemd/user/git-maintenance@.service
~/.config/systemd/user/timers.target.wants/git-maintenance@hourly.timer
~/.config/systemd/user/timers.target.wants/git-maintenance@daily.timer
~/.config/systemd/user/timers.target.wants/git-maintenance@weekly.timer</screen>
<simpara><emphasis>git maintenance start</emphasis> will overwrite these files and start the timer
again with <emphasis>systemctl --user</emphasis>, so any customization should be done by
creating a drop-in file, i.e. a <emphasis>.conf</emphasis> suffixed file in the
<emphasis>~/.config/systemd/user/git-maintenance@.service.d</emphasis> directory.</simpara>
<simpara><emphasis>git maintenance stop</emphasis> will stop the user systemd timers and delete
the above mentioned files.</simpara>
<simpara>For more details, see <emphasis>systemd.timer(5)</emphasis>.</simpara>
</simplesect>
<simplesect id="git-maintenance(1)__background_maintenance_on_macos_systems">
<title>BACKGROUND MAINTENANCE ON MACOS SYSTEMS</title>
<simpara>While macOS technically supports <emphasis>cron</emphasis>, using <emphasis>crontab -e</emphasis> requires
elevated privileges and the executed process does not have a full user
context. Without a full user context, Git and its credential helpers
cannot access stored credentials, so some maintenance tasks are not
functional.</simpara>
<simpara>Instead, <emphasis>git maintenance start</emphasis> interacts with the <emphasis>launchctl</emphasis> tool,
which is the recommended way to schedule timed jobs in macOS. Scheduling
maintenance through <emphasis>git maintenance (start|stop)</emphasis> requires some
<emphasis>launchctl</emphasis> features available only in macOS 10.11 or later.</simpara>
<simpara>Your user-specific scheduled tasks are stored as XML-formatted <emphasis>.plist</emphasis>
files in <emphasis>~/Library/LaunchAgents/</emphasis>. You can see the currently-registered
tasks using the following command:</simpara>
<screen>$ ls ~/Library/LaunchAgents/org.git-scm.git*
org.git-scm.git.daily.plist
org.git-scm.git.hourly.plist
org.git-scm.git.weekly.plist</screen>
<simpara>One task is registered for each <emphasis>--schedule=&lt;frequency&gt;</emphasis> option. To
inspect how the XML format describes each schedule, open one of these
<emphasis>.plist</emphasis> files in an editor and inspect the <emphasis>&lt;array&gt;</emphasis> element following
the <emphasis>&lt;key&gt;StartCalendarInterval&lt;/key&gt;</emphasis> element.</simpara>
<simpara><emphasis>git maintenance start</emphasis> will overwrite these files and register the
tasks again with <emphasis>launchctl</emphasis>, so any customizations should be done by
creating your own <emphasis>.plist</emphasis> files with distinct names. Similarly, the
<emphasis>git maintenance stop</emphasis> command will unregister the tasks with <emphasis>launchctl</emphasis>
and delete the <emphasis>.plist</emphasis> files.</simpara>
<simpara>To create more advanced customizations to your background tasks, see
launchctl.plist(5) for more information.</simpara>
</simplesect>
<simplesect id="git-maintenance(1)__background_maintenance_on_windows_systems">
<title>BACKGROUND MAINTENANCE ON WINDOWS SYSTEMS</title>
<simpara>Windows does not support <emphasis>cron</emphasis> and instead has its own system for
scheduling background tasks. The <emphasis>git maintenance start</emphasis> command uses
the <emphasis>schtasks</emphasis> command to submit tasks to this system. You can inspect
all background tasks using the Task Scheduler application. The tasks
added by Git have names of the form <emphasis>Git Maintenance (&lt;frequency&gt;)</emphasis>.
The Task Scheduler GUI has ways to inspect these tasks, but you can also
export the tasks to XML files and view the details there.</simpara>
<simpara>Note that since Git is a console application, these background tasks
create a console window visible to the current user. This can be changed
manually by selecting the "Run whether user is logged in or not" option
in Task Scheduler. This change requires a password input, which is why
<emphasis>git maintenance start</emphasis> does not select it by default.</simpara>
<simpara>If you want to customize the background tasks, please rename the tasks
so future calls to <emphasis>git maintenance (start|stop)</emphasis> do not overwrite your
custom tasks.</simpara>
</simplesect>
<simplesect id="git-maintenance(1)__configuration">
<title>CONFIGURATION</title>
<simpara>Everything below this line in this section is selectively included
from the <xref linkend="git-config(1)" /> documentation. The content is the same
as what's found there:</simpara>
<variablelist>
<varlistentry>
<term>
maintenance.auto
</term>
<listitem>
<simpara>
        This boolean config option controls whether some commands run
        <emphasis>git maintenance run --auto</emphasis> after doing their normal work. Defaults
        to true.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
maintenance.strategy
</term>
<listitem>
<simpara>
        This string config option provides a way to specify one of a few
        recommended schedules for background maintenance. This only affects
        which tasks are run during <emphasis>git maintenance run --schedule=X</emphasis>
        commands, provided no <emphasis>--task=&lt;task&gt;</emphasis> arguments are provided.
        Further, if a <emphasis>maintenance.&lt;task&gt;.schedule</emphasis> config value is set,
        then that value is used instead of the one provided by
        <emphasis>maintenance.strategy</emphasis>. The possible strategy strings are:
</simpara>
<itemizedlist>
<listitem>
<simpara>
<emphasis>none</emphasis>: This default setting implies no tasks are run at any schedule.
</simpara>
</listitem>
<listitem>
<simpara>
<emphasis>incremental</emphasis>: This setting optimizes for performing small maintenance
  activities that do not delete any data. This does not schedule the <emphasis>gc</emphasis>
  task, but runs the <emphasis>prefetch</emphasis> and <emphasis>commit-graph</emphasis> tasks hourly, the
  <emphasis>loose-objects</emphasis> and <emphasis>incremental-repack</emphasis> tasks daily, and the <emphasis>pack-refs</emphasis>
  task weekly.
</simpara>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>
maintenance.&lt;task&gt;.enabled
</term>
<listitem>
<simpara>
        This boolean config option controls whether the maintenance task
        with name <emphasis>&lt;task&gt;</emphasis> is run when no <emphasis>--task</emphasis> option is specified to
        <emphasis>git maintenance run</emphasis>. These config values are ignored if a
        <emphasis>--task</emphasis> option exists. By default, only <emphasis>maintenance.gc.enabled</emphasis>
        is true.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
maintenance.&lt;task&gt;.schedule
</term>
<listitem>
<simpara>
        This config option controls whether or not the given <emphasis>&lt;task&gt;</emphasis> runs
        during a <emphasis>git maintenance run --schedule=&lt;frequency&gt;</emphasis> command. The
        value must be one of "hourly", "daily", or "weekly".
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
maintenance.commit-graph.auto
</term>
<listitem>
<simpara>
        This integer config option controls how often the <emphasis>commit-graph</emphasis> task
        should be run as part of <emphasis>git maintenance run --auto</emphasis>. If zero, then
        the <emphasis>commit-graph</emphasis> task will not run with the <emphasis>--auto</emphasis> option. A
        negative value will force the task to run every time. Otherwise, a
        positive value implies the command should run when the number of
        reachable commits that are not in the commit-graph file is at least
        the value of <emphasis>maintenance.commit-graph.auto</emphasis>. The default value is
        100.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
maintenance.loose-objects.auto
</term>
<listitem>
<simpara>
        This integer config option controls how often the <emphasis>loose-objects</emphasis> task
        should be run as part of <emphasis>git maintenance run --auto</emphasis>. If zero, then
        the <emphasis>loose-objects</emphasis> task will not run with the <emphasis>--auto</emphasis> option. A
        negative value will force the task to run every time. Otherwise, a
        positive value implies the command should run when the number of
        loose objects is at least the value of <emphasis>maintenance.loose-objects.auto</emphasis>.
        The default value is 100.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
maintenance.incremental-repack.auto
</term>
<listitem>
<simpara>
        This integer config option controls how often the <emphasis>incremental-repack</emphasis>
        task should be run as part of <emphasis>git maintenance run --auto</emphasis>. If zero,
        then the <emphasis>incremental-repack</emphasis> task will not run with the <emphasis>--auto</emphasis>
        option. A negative value will force the task to run every time.
        Otherwise, a positive value implies the command should run when the
        number of pack-files not in the multi-pack-index is at least the value
        of <emphasis>maintenance.incremental-repack.auto</emphasis>. The default value is 10.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</simplesect>
<simplesect id="git-maintenance(1)__git">
<title>GIT</title>
<simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
</simplesect>
</sect2>
