Last active
March 1, 2018 05:47
-
-
Save hxgdzyuyi/90ff569ff0ac5f430114808cc049d081 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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