Makes git_update.sh handle detached heads
Merge pull request #835 from remram44/git-update

Makes git_update.sh handle detached heads