Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
LAST_MERGE_COMMIT=`git log --grep="Merge branch" -1 --pretty=format:"%h"`
HEAD_COMMIT=`git show HEAD --summary --pretty=format:"%h"`
git reset --hard ${LAST_MERGE_COMMIT}
git pull upstream master
git cherry-pick ${LAST_MERGE_COMMIT}...${HEAD_COMMIT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment