Skip to content

Instantly share code, notes, and snippets.

@2rohityadav
Last active April 2, 2020 06:06
Show Gist options
  • Save 2rohityadav/5ff7bf0f98a656a32f073cf6af92faf1 to your computer and use it in GitHub Desktop.
Save 2rohityadav/5ff7bf0f98a656a32f073cf6af92faf1 to your computer and use it in GitHub Desktop.
Using Github & bitbucket in same folder

How to Use GitHub and BitBucket at the Same Time for One Project?

You can use multiple remote repositories with git. But you'll have to push separately into 2 of your remotes.

cd project

$ git remote add github https://github.com/your_user/your_repo.git

$ git remote add bitbucket https://[email protected]/your_user/your_repo.git


Now in order to push changes to corresponding branch on github or bitbucket you can do this:

$ git push github master

$ git push bitbucket master


Same rule applies to pulling: you need to specify which remote you want to pull from:

$ git pull github master

$ git pull bitbucket master


If your project currently points to github, you can rename your current remote repository to github:

$ git remote rename origin github


Finally, to see which remote will be fetched from:

$ git remote -v show

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