Get a file that has changed many times between two commits in Git

I recently discovered that the project I'm working on has more errors than I expected, and I would like to know which files change most during our sprint.

I can do something like this, but it only shows which files have been changed, but does not show how many times they have been changed

git diff --name-only SHA1 SHA2

Please put me in the right direction to write a script to show which files changed most often between the two commits.

Thanks in advance.

+4
source share
3 answers
git log --name-only --format=%n SHA1..SHA2 | Group-Object | Format-Table Count,Name

--format=%n, , . Group-Object.

Powershell | sort | uniq -c .

+1

git -diff documentation --stat, --numstat , , :

  git diff --stat hash1 hash2

  .file1.un~ | Bin 0 -> 948 bytes
  .file2.un~ | Bin 0 -> 523 bytes
  file1      |  25 +++++++++++++++++++++++++
  file2      |   8 ++++++++
  4 files changed, 33 insertions(+)

 git diff --numstat hash1 hash2

 -       -       .file1.un~
 -       -       .file2.un~
 25      0       file1
 8       0       file2
0

10 . . 2- , sprintf, "%02d", .

git log --name-only --pretty="%n" HEAD~10..HEAD |
egrep '.' |
sort |
uniq -c  |
perl -pe 's/([0-9]+)/sprintf("%02d",$1)/e' |
sort -r |
less
0

All Articles