Skip to content

Instantly share code, notes, and snippets.

@jagill
Last active January 4, 2016 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jagill/8634769 to your computer and use it in GitHub Desktop.
Save jagill/8634769 to your computer and use it in GitHub Desktop.
Find remote branches which have been fully merged into a given branch.
baseBranch=develop
for b in `git branch -r | awk '{print $1}'`; do
numLogs=`git log --oneline $baseBranch..$b | wc -l`;
lastModified=`git show $b | grep "^Date:" | sed 's/^Date:\(.*\)/\1/'`
echo $b : $numLogs : $lastModified;
done | grep " 0 "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment