How to git push to multiple remotes with one command

There are multiple questions with even more answers on this exact question at Stack Overflow. The simplest answer, which I failed to find again, looks like this. Add the following lines to your repo’s .git/config:

[alias]
	pushall = !git push origin master && git push github master && git push remote3 master

Simply change remote and branch names to fit yours and from thereon, a git pushall will do all the work.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.