Pushing to Multiple Remote Repositories Using Git

When using Git for version control, many people use GitHub as a place to hold remote
repositories, and push their repositories there. I recently started using BitBucket
also, and wanted to be able to simultaneously update my GitHub and BitBucket repositories when changes were made.

To begin, rename your current remote (most likely named origin) to a different name. I'd rename this to the
name of the service you are using, such as github or bitbucket.

git remote rename origin github

You can then add the remote for your second remote repository, in this case, a BitBucket repository.

git remote add bitbucket git@bitbucket.org:username/example.git

Afterwards, you'll want to set up your origin remote to push to both of these. Issue the following command:

git config -e

You will be greeted with your Git configuration (most likely using vim). Add the [remote "origin"] section
to the bottom of the file with the URLs from each remote repository you'd like to push to.