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

后端 未结 5 507
别那么骄傲
别那么骄傲 2021-02-06 22:48

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.

5条回答
  •  星月不相逢
    2021-02-06 23:24

    Apart from the above listed methods you can do this too:

    git diff HEAD^..HEAD --name-only - will give the list of files changed between HEAD and one revision before HEAD (HEAD^). You can replace HEAD^ with a SHA1 of the "from" commit and HEAD with the SHA1 of the "to" commit:

    git diff .. --name-only

    So if you pipe the output to wc -l it should give you the number of files changed between commits.

提交回复
热议问题