2 .\" Title: git-for-each-repo
3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.47.0.rc0.18.ge9356ba3ea
10 .TH "GIT\-FOR\-EACH\-REPO" "1" "2024-09-30" "Git 2\&.47\&.0\&.rc0\&.18\&.ge" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-for-each-repo \- Run a Git command on a list of repositories
35 \fIgit for\-each\-repo\fR \-\-config=<config> [\-\-] <arguments>
39 Run a Git command on a list of repositories\&. The arguments after the known options or \fB\-\-\fR indicator are used as the arguments for the Git subprocess\&.
41 THIS COMMAND IS EXPERIMENTAL\&. THE BEHAVIOR MAY CHANGE\&.
43 For example, we could run maintenance on each of a list of repositories stored in a \fBmaintenance\&.repo\fR config variable using
49 git for\-each\-repo \-\-config=maintenance\&.repo maintenance run
55 This will run \fBgit \-C <repo> maintenance run\fR for each value \fB<repo>\fR in the multi\-valued config variable \fBmaintenance\&.repo\fR\&.
60 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\&.
62 These config values are loaded from system, global, and local Git config, as available\&. If
63 \fBgit for\-each\-repo\fR
64 is run in a directory that is not a Git repository, then only the system and global config is used\&.
69 Continue with the remaining repositories if the command failed on a repository\&. The exit code will still indicate that the overall operation was not successful\&.
71 Note that the exact exit code of the failing command is not passed through as the exit code of the
73 command: If the command failed in any of the specified repositories, the overall exit code will be 1\&.
75 .SH "SUBPROCESS BEHAVIOR"
77 If any \fBgit \-C <repo> <arguments>\fR subprocess returns a non\-zero exit code, then the \fBgit for\-each\-repo\fR process returns that exit code without running more subprocesses\&.
79 Each \fBgit \-C <repo> <arguments>\fR subprocess inherits the standard file descriptors \fBstdin\fR, \fBstdout\fR, and \fBstderr\fR\&.
82 Part of the \fBgit\fR(1) suite