Last Updated: February 25, 2016
·
204
· zecho

Cool one liner to push to all remotes

A lot of developers' sysadmins are concerned with redundancy so they make us store our code in a lot of places. It's pretty annoying most of the time, but it can be good sometimes because if we forget about one, we might remember another location.

Anyway, this is about how to push your code to all those remotes. Some people even have thousands of remotes depending on how busy their sysadmin was on the day they set up github. How would you do that in Eclipse or SourceTree? You probably couldn't.

This is a cool trick but you need to open up your "Terminal" application.

While you wait for that to load, copy the one liner for your operating system.

On Unix:

git remote | xargs -l git push --all --force

On OSX:

git remote | xargs -L1 git push --all --force

On Windows:

???

Now paste those into the "Terminal" application and press the enter or return key once.

The --force flag "forces" this to go a bit faster.

3 Responses
Add your response

Cool!

over 1 year ago ·

Suggesting --force is asking for trouble..

over 1 year ago ·

Suggesting --force is asking for trouble

over 1 year ago ·