git log commit count for every file

I’m trying to get the following from git log:
1- number of commits for every file in the repo (between two dates)
2- number of contributors who edited every file (between two dates)
3- number of distinct contributors who edited every file (between two dates)

I’ve tried playing with git log but I wasn’t that successful. I also tried searching for scripts but with no luck. Any help?

  • git merge squash - conflict resolution when all I want is the changes from the branch I squashed from
  • View commits that make changes to subfolder
  • How to show git status info on the right side of the terminal?
  • Why doesn't this patch apply?
  • Continuous integration and continuous delivery with git-flow
  • How to get commits information on Jenkins using Groovy since last successful build?
  • Version control advice to manage sites on a remote dedicated server
  • Resolving a Git conflict with binary files
  • git stash and git pull
  • git contributors not showing up properly in github/etc
  • omnibus or source - can't decide which one to use for gitllab backup/restore
  • Git: why do I have to commit other people's changes
  • One Solution collect form web for “git log commit count for every file”

    (when using the usual Unix tools)

    Number of commits for given file in the repo:

    git log --oneline ${filename} | wc -l
    

    Number of contributors for given file:

    git log --pretty=format:%ae ${filename} | sort -u | wc -l
    

    Number of contributors for given file between two dates:

    git log --since=${date1} --until=${date2} --pretty=format:%ae ${filename} \
        | sort -u | wc -l
    

    Now, to iterate this for every file in current repo, you’d do something along the lines of:

    find | grep -v '^\./\.git' | while read filename
    do
        echo "${filename} has $(git log --oneline ${filename} | wc -l) commits"
    done
    
    Git Baby is a git and github fan, let's start git clone.