Skip to content

Instantly share code, notes, and snippets.

@devinrhode2
Created January 18, 2022 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devinrhode2/b199bf2a29d7b72a53f79626aa546770 to your computer and use it in GitHub Desktop.
Save devinrhode2/b199bf2a29d7b72a53f79626aa546770 to your computer and use it in GitHub Desktop.
breakout small PR

Add to your .gitconfig:

[alias]
  breakout-small-pr = "!runit() { CURRENT_BRANCH=`git branch --show-current`; echo checkout $1 && git checkout $1 && echo delete $2 locally && git branch -D $2 || true && echo create fresh $2 && git checkout -b $2 && echo force publish && git publish-branch --force && echo back to original branch && git checkout $CURRENT_BRANCH; }; runit"

Then:

git break<TAB> 
git breakout-small-pr
git breakout-small-pr HEAD^8 1-refactor-things

rinse and repeat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment