Created
December 27, 2013 13:46
-
-
Save phcostabh/8147081 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) | |
| YELLOW='\e[0;33m' | |
| NO_COLOR='\e[0m' #disable any colors | |
| success () { | |
| echo | |
| echo -e "${YELLOW}**** $1${NO_COLOR}" | |
| echo | |
| } | |
| success "Pulling changes into Live [Hub's post-update hook]" | |
| cd /home/desenvolvedores/philippe.costa/public_html/Letras || exit | |
| unset GIT_DIR | |
| if [[ $branch =~ 'refs/heads' ]]; then | |
| branch=${branch##*/} | |
| success "Deleting branch $branch" | |
| git checkout -f master | |
| git branch -D $branch | |
| exit | |
| fi | |
| git reset --hard HEAD | |
| success "Checking out branch $branch" | |
| git checkout -b $branch &> /dev/null || git checkout $branch | |
| success "Updating branch $branch" | |
| git pull --strategy=recursive -X theirs 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