summaryrefslogtreecommitdiff
path: root/devdocs/git/git-for-each-repo.html
blob: f904a74f1215426cd60ee11fd6e707120b481e46 (plain)
1
2
3
4
5
6
<h1>git-for-each-repo</h1>  <h2 id="_name">Name</h2> <div class="sectionbody">  <p>git-for-each-repo - Run a Git command on a list of repositories</p>  </div>   <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <div class="verseblock"> <pre class="content" data-language="shell">git for-each-repo --config=&lt;config&gt; [--] &lt;arguments&gt;</pre> </div> </div>   <h2 id="_description">Description</h2> <div class="sectionbody">  <p>Run a Git command on a list of repositories. The arguments after the known options or <code>--</code> indicator are used as the arguments for the Git subprocess.</p>   <p>THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.</p>   <p>For example, we could run maintenance on each of a list of repositories stored in a <code>maintenance.repo</code> config variable using</p>  <div class="listingblock"> <div class="content"> <pre data-language="shell">git for-each-repo --config=maintenance.repo maintenance run</pre> </div> </div>  <p>This will run <code>git -C &lt;repo&gt; maintenance run</code> for each value <code>&lt;repo&gt;</code> in the multi-valued config variable <code>maintenance.repo</code>.</p>  </div>   <h2 id="_options">Options</h2> <div class="sectionbody"> <div class="dlist"> <dl> <dt class="hdlist1" id="Documentation/git-for-each-repo.txt---configltconfiggt"> --config=&lt;config&gt; </dt> <dd> <p>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.</p>  <p>These config values are loaded from system, global, and local Git config, as available. If <code>git for-each-repo</code> is run in a directory that is not a Git repository, then only the system and global config is used.</p>  </dd> </dl> </div> </div>   <h2 id="_subprocess_behavior">Subprocess behavior</h2> <div class="sectionbody">  <p>If any <code>git -C &lt;repo&gt; &lt;arguments&gt;</code> subprocess returns a non-zero exit code, then the <code>git for-each-repo</code> process returns that exit code without running more subprocesses.</p>   <p>Each <code>git -C &lt;repo&gt; &lt;arguments&gt;</code> subprocess inherits the standard file descriptors <code>stdin</code>, <code>stdout</code>, and <code>stderr</code>.</p>  </div><div class="_attribution">
  <p class="_attribution-p">
    &copy; 2012&ndash;2024 Scott Chacon and others<br>Licensed under the MIT License.<br>
    <a href="https://git-scm.com/docs/git-for-each-repo" class="_attribution-link">https://git-scm.com/docs/git-for-each-repo</a>
  </p>
</div>