phpman > man > git-for-each-repo(1)

Markdown | JSON | MCP    

TLDR: git-for-each-repo (tldr-pages)

Run a Git command on a list of repositories.

  • Run maintenance on each of a list of repositories stored in the `maintenance.repo` user configuration variable
    git for-each-repo --config maintenance.repo {{maintenance run}}
  • Run `git pull` on each repository listed in a global configuration variable
    git for-each-repo --config {{global_configuration_variable}} {{pull}}
GIT-FOR-EACH-REPO(1)                         Git Manual                         GIT-FOR-EACH-REPO(1)



NAME
       git-for-each-repo - Run a Git command on a list of repositories

SYNOPSIS
       git for-each-repo --config=<config> [--] <arguments>


DESCRIPTION
       Run a Git command on a list of repositories. The arguments after the known options or --
       indicator are used as the arguments for the Git subprocess.

       THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

       For example, we could run maintenance on each of a list of repositories stored in a
       maintenance.repo config variable using

           git for-each-repo --config=maintenance.repo maintenance run


       This will run git -C <repo> maintenance run for each value <repo> in the multi-valued config
       variable maintenance.repo.

OPTIONS
       --config=<config>
           Use the given config variable as a multi-valued list storing absolute path names. Iterate
           on that list of paths to run the given arguments.

           These config values are loaded from system, global, and local Git config, as available.
           If git for-each-repo is run in a directory that is not a Git repository, then only the
           system and global config is used.

SUBPROCESS BEHAVIOR
       If any git -C <repo> <arguments> subprocess returns a non-zero exit code, then the git
       for-each-repo process returns that exit code without running more subprocesses.

       Each git -C <repo> <arguments> subprocess inherits the standard file descriptors stdin,
       stdout, and stderr.

GIT
       Part of the git(1) suite



Git 2.34.1                                   02/26/2026                         GIT-FOR-EACH-REPO(1)

Generated by phpman local Author: Che Dong Under GNU General Public License
2026-06-15 07:20 @216.73.216.200
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 TransitionalValid CSS!