I have one repository which I want to push into Bitbucket and GitHub.
It is vital for my repository to be hosted by both.
Is there a way to do this in Git?
You can use multiple remote repositories with git. Check this: http://gitref.org/remotes/
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
$ git remote rename origin github
You can then add another remote repository, say
$ git remote add bitbucket firstname.lastname@example.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