Created
August 22, 2015 21:55
-
-
Save cmatskas/c1a0bf77be83a681d7f2 to your computer and use it in GitHub Desktop.
Git merge detached head
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 checkout –b temp #makes a new branch from current detached HEAD | |
$git branch –f master temp #update master to point to the new <temp> branch | |
$git branch –d temp #delete the <temp> branch | |
$git push origin master #push the re-established history |
And one more ;-) Probably you need to do git branch --unset-upstream
and then git push --set-upstream origin master
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Slight addition. You would need to switch to a different branch before you can delete the
temp
branch. So a$ git checkout master
should be run before the delete oftemp