Skip to content

Instantly share code, notes, and snippets.

@nikreiman
Created September 16, 2011 15: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 nikreiman/1222337 to your computer and use it in GitHub Desktop.
Save nikreiman/1222337 to your computer and use it in GitHub Desktop.
Function to view all git commits for a given branch
function git-log-for-branch() {
branch="$1"
git --no-pager log --format=online --no-merges $branch --not \
$(git for-each-ref --format="%(refname)" refs/remotes/origin | \
grep -F -v $branch)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment