Created
May 16, 2017 17:50
-
-
Save zackfern/f305bd2ea0fd81b71c9edb2c177afcc1 to your computer and use it in GitHub Desktop.
merged function for easily telling if a Git branch has been merged into the current branch
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
merged () { | |
CURRENT=`git rev-parse --abbrev-ref HEAD`; | |
if git merge-base --is-ancestor $1 $CURRENT; then | |
echo "\e[32m$1 is merged into $CURRENT" | |
else | |
echo "\e[31m$1 is NOT merged into $CURRENT" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment