Skip to content

Instantly share code, notes, and snippets.

View eoli3n's full-sized avatar
🍕
I wish to be a ninja turtle in my next life

Jonathan Kirszling eoli3n

🍕
I wish to be a ninja turtle in my next life
View GitHub Profile
@eoli3n
eoli3n / multiple-push-urls.md
Created June 25, 2023 10:14 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this: