git add remote "all"</h2>
It starts to become bothersome having to push to multiple remote repos (i.e. Github and my nas) manually one-by-one.
Linus Torvalds, the creator of git, mentioned1</a></sup> back in 2006 that he uses the following method:</p>
So for "git push" (where it makes sense to push the same branches multiple
times), you can actually do what I do:</p>
- .git/config contains:</p>
[remote "all"]</p>
url = master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6</p>
url = login.osdl.org:linux-2.6.git</p>
- and not "git push all master" will push the "master" branch to both</em>
of those remote repositories.</p>
</blockquote>
However, he notes a few issues around fetching, and I think this can be simplified by using some git features that probably didn't exist back in 2006.</p>
So why not create an alias?</p>
Now I can easily push to every remote using
git alias pushall</h2>
git</span> config</span> -</span>-global</span> alias.pushall</span> '</span>!git remote | xargs -L1 git push --all</span>'</span></span></code></pre>
git pushall</code>.</p>

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.