head gets detached when checking out branch with origin code example Example: head detached at origin/master git checkout master