Skip to content

Instantly share code, notes, and snippets.

@vladislav805
Created October 2, 2019 12:50
Show Gist options
  • Save vladislav805/885c9b71b3fec87973aa2de6b656a817 to your computer and use it in GitHub Desktop.
Save vladislav805/885c9b71b3fec87973aa2de6b656a817 to your computer and use it in GitHub Desktop.
HEAD detached fix
TARGET_BRANCH="master"
TEMPORARY_BRANCH="temp"
git branch "$TEMPORARY_BRANCH"
git checkout "$TEMPORARY_BRANCH"
git branch -f "$TARGET_BRANCH" "$TEMPORARY_BRANCH"
git checkout "$TARGET_BRANCH"
git branch -d "$TEMPORARY_BRANCH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment