Skip to content

Instantly share code, notes, and snippets.

@matt-snider
Created September 1, 2015 15:29
Show Gist options
  • Save matt-snider/76b36cdba16750b1bfd5 to your computer and use it in GitHub Desktop.
Save matt-snider/76b36cdba16750b1bfd5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# git-branch-diff
#
# Shows the difference in commits between two branches. If only
# one branch is given, the other defaults to HEAD.
#
# msnider$
if [[ $# -eq 1 ]] ; then
git log --oneline HEAD..$1
elif [[ $# -eq 2 ]] ; then
git log --oneline $1..$2
else
echo "error: must specify at least one branch" >&2; exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment