summaryrefslogtreecommitdiffstats
path: root/man1/git-for-each-repo.1
blob: 3f45a313468681212a1def57b15eed0f0051e609 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
'\" t
.\"     Title: git-for-each-repo
.\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
.\"      Date: 2024-04-30
.\"    Manual: Git Manual
.\"    Source: Git 2.45.0.31.gd4cc1ec35f
.\"  Language: English
.\"
.TH "GIT\-FOR\-EACH\-REPO" "1" "2024\-04\-30" "Git 2\&.45\&.0\&.31\&.gd4cc1ec" "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
.sp
.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
.sp
This will run \fBgit \-C <repo> maintenance run\fR for each value \fB<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 for\-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 \-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\&.
.sp
Each \fBgit \-C <repo> <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