Jul 17

easy way to change the current branch (HEAD) on a remote git repo...

Wed, 07/17/2013 - 10:00 — peter

Just had an interesting problem today where I needed to blast away the remote copy of a git master branch (don't ask!), but I couldn't do that because it was the current branch.

I quick question to a local git guru and the answer was very easy:

git remote set-head <remote> <branch>

Then I was able to delete the rotten origin/master branch, create it again from a good branch, reset it to HEAD and life was good again!

Easy Peasy!

-PCP