Skip to content

Instantly share code, notes, and snippets.

@ace3
Created April 9, 2021 02:43
Show Gist options
  • Save ace3/bc4450872aad6c5acc3065704b418f01 to your computer and use it in GitHub Desktop.
Save ace3/bc4450872aad6c5acc3065704b418f01 to your computer and use it in GitHub Desktop.

To setup push to multiple remote with single git push, you need to do this:

  • Clone the repo like usual
  • Setup multi remote URL like this
git remote set-url --add --push origin [email protected]:[username]/[repository]
git remote set-url --add --push origin [email protected]:[username]/[repository]

Take notes on the --push, meaning only add the push side of the remote.

  • Verify by run this command git remote -v , then you should see something like this:
origin	[email protected]:[username]/[repository] (fetch)
origin	[email protected]:[username]/[repository] (push)
origin	[email protected]:[username]/[repository] (push)

I used this for my Next.js development, using my personal github account and gitlab group account.

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