git: list of all changed files including those in submodules

前端 未结 6 1706
死守一世寂寞
死守一世寂寞 2020-12-08 02:53

I would like to get a list of all files, which have changed betweet two commits including those in submodules.

I know I can do this:

git diff --name-         


        
6条回答
  •  太阳男子
    2020-12-08 03:19

    Update 2017: as I mentioned in "see diff of commit on submodule in gitlab",

    • Git 2.11 (Nov. 2016) introduces

      git diff --submodule=diff
      
    • Git 2.14 (Q3 2017) will improve that by recursing into nested submodules.
      See commit 5a52214 (04 May 2017) by Stefan Beller (stefanbeller).
      (Merged by Junio C Hamano -- gitster -- in commit a531ecf, 29 May 2017)


    Original 2012 answer (pre 2017 Git 2.14)

    Maybe a simple line would be enough:

    git submodule foreach --recursive git diff --name-status
    

    That would actually list files in submodules within submodules.
    (The --recursive option comes from git1.7.3+)

提交回复
热议问题