pushing all git remote repositories

I'm now working on a project that is hosted on github AND rubyforge. And lazy as I am, I don't want to do:

CODE:
  1. git push origin
  2. git push rubyforge

That's why I create a handy shortcut for it and placed it in my ~/.bashrc:

CODE:
  1. function git-push-all() {
  2. for remote in `git remote`; do
  3. git push $remote
  4. done
  5. }

What it does: it lists all remote repositories linked to that git project and pushes them all. Usage:

CODE:
  1. git-push-all

Don't get confused with "git-push --all"! That's something completely different!

0 comments ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment