Created
December 17, 2014 13:29
-
-
Save pablocarrillo/93347b5ba515f4bc2124 to your computer and use it in GitHub Desktop.
Forking to bitbucket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
git clone https://github.com/user/yourRepo | |
cd repo | |
git remote rename origin upstream | |
git remote add origin https://[email protected]/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