Skip to content

Instantly share code, notes, and snippets.

@kevinkepp
Created February 5, 2014 15:39
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 kevinkepp/8826332 to your computer and use it in GitHub Desktop.
Save kevinkepp/8826332 to your computer and use it in GitHub Desktop.
Show the number of commits of each branch in the Git repository
#!/bin/sh
for branch in `git branch | grep -v '\->'`;
do
git checkout $branch
no=$(git log --pretty=oneline | wc -l)
echo -e "$branch:\t$no"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment