List all the files that ever existed in a Git repository

后端 未结 4 527
夕颜
夕颜 2020-11-30 17:05

Do you have a clean way to list all the files that ever existed in specified branch?

4条回答
  •  孤城傲影
    2020-11-30 17:55

    You can run git-log --name-status, which echoes something like:

    commit afdbbaf52ab24ef7ce1daaf75f3aaf18c4d2fee0
    Author: Your Name 
    Date:   Tue Aug 12 13:28:34 2008 -0700
    
        Added test file.
    
    A       test
    

    Then extract files added:

    git-log --name-status | sed -ne 's/^A[^u]//p' | sort -u
    

提交回复
热议问题