>
  1. If the local branch is same as the remote branch, we can simply do:

    git push coding master
    git push github master

Note: this is the recommended way.

  1. If the local branch has a different name of remote branch, we can do:

    git push coding localbranch:master
    git push github localbranch:master

Caution: it’s not recommended to have a different local branch name of the remote branch name.

  1. We can synchronize the local changes to all remote repositories by one command

    git remote add all http://github.com
    git remote set-url origin –push –add http://coding.net
    git remote set-url origin –push –add http://github.com

Now, we can simply exit git push all branch to push local commits to all remote repositories.

Syntax:

git push [remote alias] [local branch] : [remote branch]