Search code examples
gitgitosis

How do I count the number of commits made in to all repos hosted by gitosis on my server


I am trying to found out the total number of commits made across all repositories hosted on a gitosis install I have. Anyone have any ideas to how I may do this?


Solution

  • ls /path/to/repos/ | xargs -I % git --git-dir=/path/to/repos/%/.git rev-list --all 2>/dev/null | wc -l
    

    That works fairly well for me. You can grep -v zip or use a more specific find query to just find specific directories, too.

    Update: use rev-list --all instead of log --pretty=oneline.