Skip to content

Instantly share code, notes, and snippets.

@eltonjr
Created November 7, 2015 22:00
Show Gist options
  • Save eltonjr/36b65fa3daf7367a4ace to your computer and use it in GitHub Desktop.
Save eltonjr/36b65fa3daf7367a4ace to your computer and use it in GitHub Desktop.
Counting the number of merges in a given repository
#!/bin/bash
AFTER="2015-11-1"
BEFORE=$TODAY
echo "Number of commits: " `git log --first-parent --after=$AFTER --before=$BEFORE --format="%s" | wc -l`
echo "Merges: " `git log --first-parent --after=$AFTER --before=$BEFORE --merges --format="%s" | wc -l`
echo "No-merges: " `git log --first-parent --after=$AFTER --before=$BEFORE --no-merges --format="%s" | wc -l`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment