handle detached HEAD with new branch switching commands
echo expanded commands as they are executed

in case something goes wrong
pull to make sure deploy branch is up to date before committing