Skip to content

Instantly share code, notes, and snippets.

@jimschubert
Created February 14, 2014 14:14
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 jimschubert/9001653 to your computer and use it in GitHub Desktop.
Save jimschubert/9001653 to your computer and use it in GitHub Desktop.
Display log messages for commits in a given branch
#!/bin/sh
branchname=""
case $# in
0) branchname=$(git rev-parse --abbrev-ref HEAD) ;;
1) branchname="$1" ;;
*) branchname="$1" ;;
esac
git log $branchname --not $(git for-each-ref --format='%(refname)' refs/heads/ | grep -v "$branchname")
@jimschubert
Copy link
Author

Drop this into /usr/local/bin and then execute with git branchlog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment