Created
February 29, 2016 13:58
-
-
Save davidpdrsn/1ea8a88dc07553781ecb 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 | |
| set -e | |
| function git_branch_name { | |
| val=`git branch 2>/dev/null | grep '^*' | colrm 1 2` | |
| echo "$val" | |
| } | |
| branch=`git_branch_name` | |
| target=$1 | |
| echo "--- Checking out $target" | |
| git checkout $target | |
| echo "" | |
| echo "--- Pulling" | |
| git smart-pull | |
| echo "" | |
| echo "--- Checking out $branch" | |
| git checkout $branch | |
| echo "" | |
| echo "--- Rebasing" | |
| git rebase $target | |
| echo "" | |
| echo "--- Force pushing" | |
| git push -f | |
| echo "" | |
| echo "--- Checking out $target" | |
| git checkout $target | |
| echo "" | |
| echo "--- Merging" | |
| git merge --ff-only $branch | |
| echo "" | |
| echo "--- Running the tests" | |
| script/cibuild | |
| echo "" | |
| echo "--- Pushing" | |
| git push | |
| echo "" | |
| echo "--- Nuking remote branch" | |
| git branch -D $branch | |
| git push origin :$branch | |
| git branch --delete --remotes origin/$branch | |
| git fetch origin --prune | |
| echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment