Skip to content

Instantly share code, notes, and snippets.

@calebhearth
Last active December 15, 2015 19:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calebhearth/5314351 to your computer and use it in GitHub Desktop.
Save calebhearth/5314351 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
branch_pattern="^## (.*)$"
git_status=`git status -sb`
if [[ $git_status =~ $branch_pattern ]]
then
echo ${BASH_REMATCH[1]}
fi
#!/usr/bin/env zsh
successfully() {
$* || (echo "failed" 1>&2 && exit 1)
}
successfully git fetch
successfully git rebase -i origin/master
successfully git push -f
successfully git checkout master
successfully git merge `git current-branch`
successfully git push
successfully git push origin --delete `git current-branch`
successfully git branch -d `git current-branch`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment