Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created August 19, 2016 15:37
Show Gist options
  • Save mitsuhiko/fc8791684d6e6cfece5b8e9c5e9eee42 to your computer and use it in GitHub Desktop.
Save mitsuhiko/fc8791684d6e6cfece5b8e9c5e9eee42 to your computer and use it in GitHub Desktop.
addprx = "!f() { b=`git symbolic-ref -q --short HEAD` && \
echo \"Making branch for pull request #$1 [pr/$1]\" && \
git fetch origin pull/$1/head:pr/$1 && \
echo \"Rebasing pr/$1 onto $b...\" && \
git fetch -q -f origin pull/$1/merge:refs/PR_MERGE_HEAD && \
git rebase -q --onto $b PR_MERGE_HEAD^ pr/$1 && \
git checkout -q $b && echo && \
git diff --stat $b..pr/$1 && echo && \
git log --oneline $b..pr/$1; \
git update-ref -d refs/PR_MERGE_HEAD; \
}; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment