Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the number of files changed from one commit to another in git

Tags:

git

I am working on a git repository which contains huge number of files changed b/w one commit to another, how to extract the number of files changes b/w commits.

like image 797
Talespin_Kit Avatar asked Jul 05 '11 14:07

Talespin_Kit


People also ask

How do you check Committed changes?

If you have the hash for a commit, you can use the git show command to display the changes for that single commit. The output is identical to each individual commit when using git log -p .

How do I see file commit history?

Git file History provides information about the commit history associated with a file. To use it: Go to your project's Repository > Files. In the upper right corner, select History.


1 Answers

EDIT: "this will always count the files plus one, cause the --format=oneline includes the commit-hash/header" as mentioned by c00kiemon5ter


The git whatchanged tool shows you a summary of files that were modified. By itself it lists all commits, but you can also limit it to just the recent n commits:

git whatchanged -1 

To count files:

git whatchanged -1 --format=oneline | wc -l 

See git help whatchanged for details.

like image 59
Kerrek SB Avatar answered Oct 03 '22 21:10

Kerrek SB