Created
July 31, 2013 17:55
-
-
Save richsoni/6124408 to your computer and use it in GitHub Desktop.
Alias to cherry pick either the last commit on the last branch or the last commit on a given branch
This file contains hidden or 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/sh | |
gcherry(){ | |
if [ $1 ];then | |
name=$1 | |
else | |
name="@{-1}" | |
fi | |
echo "cherry picking $( git reflog $name -n 1 )" | |
git cherry-pick $( git reflog $name -n 1 | awk '{print $1}' ) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment