two samples to solve situations where repositories have been imported instead of forked
This file contains 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 remote add downstream UrlOfImportedRepo | |
#foreach branch you want to bring back | |
git fetch downstream/branchname | |
git checkout branchname | |
git merge downstream/branchname #hopefully your history is not a mess and you don’t have conflicts to handle | |
git push origin | |
#end of foreach | |
git remote remove downstream |
This file contains 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 remote remove origin | |
git remote add origin "new url of the repo" | |
git fetch origin | |
#for each branch you have locally (the ones in white when running git branch -a) | |
git checkout branchname | |
git branch --set-upstream-to origin/branchname | |
git pull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment