Skip to content

Instantly share code, notes, and snippets.

@coherencez
Last active September 18, 2025 12:35
Show Gist options
  • Save coherencez/d4605f1eecff45f89538321c9dce4495 to your computer and use it in GitHub Desktop.
Save coherencez/d4605f1eecff45f89538321c9dce4495 to your computer and use it in GitHub Desktop.
Setup multiple origin push urls for git repos -- one git push: multiple repos

Create multiple origin push urls for GitHub.

  1. We want to make sure to add a new remote as normal: git remote add <remote name> <url for git repo>

  2. Now we can setup multiple origin push urls:

  • git remote set-url --add --push origin <git url one>
  • git remote set-url --add --push origin <git url two>
  1. Last step, you will need to set the upstream branch again git push -u origin master

Done! Now whenever you run git push it will simultaneously push to both remote repos.

You can type git config -l (list) or git config -e (edit) to confirm. You should see two remote.origin.pushurls in there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment