Created
December 19, 2020 12:57
-
-
Save volkovasystems/e45eed803f7d8060caf10d9a9c1530c8 to your computer and use it in GitHub Desktop.
git move branch to orphaned branch
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
If the orphaned branch is master and you want to move the main branch | |
(note that all branches must have corresponding remote branches to work properly) | |
git checkout master | |
then | |
git branch -M master main | |
then | |
git checkout master | |
then | |
git checkout main | |
then | |
git config remote.origin.push HEAD | |
then | |
git push --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment