DEV Community

loading...

Discussion on: Same Repo On Both Bitbucket And Github

Collapse
_garybell profile image
Gary Bell

Whenever I've needed to use different remotes, I've set them up to be completely different remote names. For instance if I had the origin on GitLab as git@gitlab.com:garybell/myproject.git, but also wanted to host it on GitHub, I'd run the following:
git remote add github git@github.com:garybell/myproject.git
Following any commit messages, I can then run:
git push origin branch && git push github branch, and the changes are pushed to both.

Collapse
vikrampawar profile image
vikrampawar Author

That’s a good option as well. If I remember correctly ‘origin’ is just a branch like any other. It is the main branch by convention and there is nothing special about it.

Collapse
_garybell profile image
Gary Bell

Origin is just the name of the remote, yes. Much like master is the branch. I've just found that naming them to they are useful when using more than just "origin" helps