git-for-each-repo.1 (3389B)
- '\" t
- .\" Title: git-for-each-repo
- .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
- .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
- .\" Date: 2025-03-14
- .\" Manual: Git Manual
- .\" Source: Git 2.49.0
- .\" Language: English
- .\"
- .TH "GIT\-FOR\-EACH\-REPO" "1" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
- .\" -----------------------------------------------------------------
- .\" * Define some portability stuff
- .\" -----------------------------------------------------------------
- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- .\" http://bugs.debian.org/507673
- .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- .ie \n(.g .ds Aq \(aq
- .el .ds Aq '
- .\" -----------------------------------------------------------------
- .\" * set default formatting
- .\" -----------------------------------------------------------------
- .\" disable hyphenation
- .nh
- .\" disable justification (adjust text to left margin only)
- .ad l
- .\" -----------------------------------------------------------------
- .\" * MAIN CONTENT STARTS HERE *
- .\" -----------------------------------------------------------------
- .SH "NAME"
- git-for-each-repo \- Run a Git command on a list of repositories
- .SH "SYNOPSIS"
- .sp
- .nf
- \fIgit for\-each\-repo\fR \-\-config=<config> [\-\-] <arguments>
- .fi
- .SH "DESCRIPTION"
- .sp
- 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\&.
- .sp
- THIS COMMAND IS EXPERIMENTAL\&. THE BEHAVIOR MAY CHANGE\&.
- .sp
- For example, we could run maintenance on each of a list of repositories stored in a \fBmaintenance\&.repo\fR config variable using
- .sp
- .if n \{\
- .RS 4
- .\}
- .nf
- git for\-each\-repo \-\-config=maintenance\&.repo maintenance run
- .fi
- .if n \{\
- .RE
- .\}
- .sp
- This will run \fBgit\fR \fB\-C\fR \fI<repo>\fR \fBmaintenance\fR \fBrun\fR for each value \fI<repo>\fR in the multi\-valued config variable \fBmaintenance\&.repo\fR\&.
- .SH "OPTIONS"
- .PP
- \-\-config=<config>
- .RS 4
- 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\&.
- .sp
- These config values are loaded from system, global, and local Git config, as available\&. If
- \fBgit\fR
- \fBfor\-each\-repo\fR
- is run in a directory that is not a Git repository, then only the system and global config is used\&.
- .RE
- .PP
- \-\-keep\-going
- .RS 4
- 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\&.
- .sp
- Note that the exact exit code of the failing command is not passed through as the exit code of the
- \fBfor\-each\-repo\fR
- command: If the command failed in any of the specified repositories, the overall exit code will be 1\&.
- .RE
- .SH "SUBPROCESS BEHAVIOR"
- .sp
- If any \fBgit\fR \fB\-C\fR \fI<repo>\fR \fI<arguments>\fR subprocess returns a non\-zero exit code, then the \fBgit\fR \fBfor\-each\-repo\fR process returns that exit code without running more subprocesses\&.
- .sp
- Each \fBgit\fR \fB\-C\fR \fI<repo>\fR \fI<arguments>\fR subprocess inherits the standard file descriptors \fBstdin\fR, \fBstdout\fR, and \fBstderr\fR\&.
- .SH "GIT"
- .sp
- Part of the \fBgit\fR(1) suite