Git: Dealing with Multiple Remote URLs

Adding multiple remote URLs to your codebase:

Here is the step-by-step guide, very well written!

Pull and push from multiple remote URLs:

  • To pull all branches from multiple remotes: git pull --all
  • To pull specific branch from multiple remotes: git pull --all <branch>
  • To push all branches to multiple remotes: git remote | xargs -L1 git push --all
  • To push specific branch to multiple remotes: git remote | xargs -L1 -I R git push R <branch>

For more info on git push commands, checkout the answer at the stack overflow.

Delete URL

git remote remove <url_name>

Rename URL

git remote rename <url_oldname> <url_newname>

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store