Search code examples
windowsgitgit-maintenance

Check if git maintenance is active?


How can I know whether I have already ran git maintenance start (doc) on a git repository?

The Windows tasks scheduler shows me 3 tasks (hourly, daily, weekly), but no information about which repos are involved.


Solution

  • Check the maintenance.repo config variable at ~/.gitconfig (either by opening the file directly, or with config related comands, i.e. git config --global --get-all maintenance.repo) (Thank you Guildenstern for the useful tip about --get-all, since --get only returns the last value indeed)

    It lists all repositories registered for maintenance.

    Reference: (doc)

    register

    Initialize Git config values so any scheduled maintenance will start running on this repository. This adds the repository to the maintenance.repo config variable in the current user’s global config, or the config specified by --config-file option, and enables some recommended configuration values for maintenance..schedule. The tasks that are enabled are safe for running in the background without disrupting foreground processes.