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 git@github.com:[username]/[repository]
git remote set-url --add --push origin git@bitbucket.org:[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 git@github.com:[username]/[repository] (fetch)
origin git@github.com:[username]/[repository] (push)
origin git@bitbucket.org:[username]/[repository] (push)
I used this for my Next.js development, using my personal github account and gitlab group account.