]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-for-each-repo.txt
Start the 2.46 cycle
[thirdparty/git.git] / Documentation / git-for-each-repo.txt
CommitLineData
4950b2a2
DS
1git-for-each-repo(1)
2====================
3
4NAME
5----
6git-for-each-repo - Run a Git command on a list of repositories
7
8
9SYNOPSIS
10--------
11[verse]
12'git for-each-repo' --config=<config> [--] <arguments>
13
14
15DESCRIPTION
16-----------
17Run a Git command on a list of repositories. The arguments after the
18known options or `--` indicator are used as the arguments for the Git
19subprocess.
20
21THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
22
23For example, we could run maintenance on each of a list of repositories
24stored in a `maintenance.repo` config variable using
25
26-------------
27git for-each-repo --config=maintenance.repo maintenance run
28-------------
29
30This will run `git -C <repo> maintenance run` for each value `<repo>`
31in the multi-valued config variable `maintenance.repo`.
32
33
34OPTIONS
35-------
36--config=<config>::
37 Use the given config variable as a multi-valued list storing
38 absolute path names. Iterate on that list of paths to run
39 the given arguments.
40+
41These config values are loaded from system, global, and local Git config,
42as available. If `git for-each-repo` is run in a directory that is not a
43Git repository, then only the system and global config is used.
44
12c2ee5f
JS
45--keep-going::
46 Continue with the remaining repositories if the command failed
47 on a repository. The exit code will still indicate that the
48 overall operation was not successful.
49+
50Note that the exact exit code of the failing command is not passed
51through as the exit code of the `for-each-repo` command: If the command
52failed in any of the specified repositories, the overall exit code will
53be 1.
4950b2a2
DS
54
55SUBPROCESS BEHAVIOR
56-------------------
57
58If any `git -C <repo> <arguments>` subprocess returns a non-zero exit code,
59then the `git for-each-repo` process returns that exit code without running
60more subprocesses.
61
62Each `git -C <repo> <arguments>` subprocess inherits the standard file
63descriptors `stdin`, `stdout`, and `stderr`.
64
65
66GIT
67---
68Part of the linkgit:git[1] suite