Skip to content

Instantly share code, notes, and snippets.

@mogelbrod
Created March 7, 2014 17:18
Show Gist options
  • Save mogelbrod/9415704 to your computer and use it in GitHub Desktop.
Save mogelbrod/9415704 to your computer and use it in GitHub Desktop.
gbump () {
what=${1:-patch}
echo "Bumping $what version and pushing to origin"
changed=$(git diff-index --name-only HEAD --)
[ -n "$changed" ] && git stash
git pull --rebase && npm version $what && git push && git push --tags
[ -n "$changed" ] && git stash pop
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment