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

后端 未结 5 501
别那么骄傲
别那么骄傲 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:44

    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.

提交回复
热议问题