Skip to content

Instantly share code, notes, and snippets.

@pablocarrillo
Created December 17, 2014 13:29
Show Gist options
  • Save pablocarrillo/93347b5ba515f4bc2124 to your computer and use it in GitHub Desktop.
Save pablocarrillo/93347b5ba515f4bc2124 to your computer and use it in GitHub Desktop.
Forking to bitbucket
```
git clone https://github.com/user/yourRepo
cd repo
git remote rename origin upstream
git remote add origin https://yourAccount@bitbucket.org/yourAccount/yourRepo
git push --mirror origin
```
Then make sure master will pull from the bitbucket repo (upstream being the name of the remote referring to the original GitHub repo)
```
git checkout master
git branch -u origin/master
```
This last step is optional. Matching clone all the branches in one go
`git push.default matching`
The git push will push to the bitbucket repo (origin), but you need git pull upstream to pull/update from the original GitHub repo.
By default, you will be working with the BitBucket one (like all other developers cloning that new repo), but a developer can add at any moment a reference (remote) to the original GitHub repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment