Skip to content

Instantly share code, notes, and snippets.

@davidpdrsn
Created February 29, 2016 13:58
Show Gist options
  • Select an option

  • Save davidpdrsn/1ea8a88dc07553781ecb to your computer and use it in GitHub Desktop.

Select an option

Save davidpdrsn/1ea8a88dc07553781ecb to your computer and use it in GitHub Desktop.
#!/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