-
-
Save tebajanga/ca45a3d3b986ef88e8028aebf956910f 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 |
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 of temp