Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Created December 20, 2013 14:20
Show Gist options
  • Select an option

  • Save phcostabh/8055404 to your computer and use it in GitHub Desktop.

Select an option

Save phcostabh/8055404 to your computer and use it in GitHub Desktop.
#!/bin/bash
branch=$(git rev-parse --abbrev-ref $1)
echo
echo "**** Pulling changes into Live [Hub's post-update hook]"
echo
cd /home/desenvolvedores/philippe.costa/public_html/Letras || exit
unset GIT_DIR
if [[ $branch =~ 'refs/heads' ]]; then
branch=${branch##*/}
echo
echo "**** Deleting branch $branch"
echo
git checkout -f master
git branch -D $branch
exit
fi
git reset --hard HEAD
echo
echo "**** Updating branch $branch"
echo
git checkout -b $branch &> /dev/null || git checkout $branch
git pull hub $branch
exec git-update-server-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment