How to use Bitbucket and GitHub 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 I believe.

For example, if your project currently points to github, you can rename your current remote repository to github:

$ git remote rename origin github

You can then add another remote repository, say bitbucket:

$ git remote add bitbucket git@bitbucket.org: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 HEAD
$ git push bitbucket HEAD

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

$ git pull github your_branch
$ git pull bitbucket your_branch

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)