Created
December 20, 2013 14:20
-
-
Save phcostabh/8055404 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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