Skip to content

Instantly share code, notes, and snippets.

@zackfern
Created May 16, 2017 17:50
Show Gist options
  • Save zackfern/f305bd2ea0fd81b71c9edb2c177afcc1 to your computer and use it in GitHub Desktop.
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
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