I've added a deploy script which detects the current branch and then among other things run this:
currentBranch=$(git rev-parse --abbrev-ref HEAD)
eval "git fetch --all # fetch all remote branches"
eval "git reset --hard origin/$currentBranch" # clean up currentBranch
and if a new branch was supplied in the bash script I'll run this:
newBranch=$1
eval "git checkout $newBranch"
But, before I ran it I noticed the server's current branch is HEAD (should have been master).
What is the effect of git reset --hard origin/HEAD before I run the deploy. I don't care about any tracked files on HEAD I just want the switch to a new branch to test it, and later I'll return it to what it should be which is master. Just not sure what happens if I run the reset right now with a detached HEAD.