List all the files that ever existed in a Git repository

后端 未结 4 523
夕颜
夕颜 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:56

    This is a simplified variation of Strager's solution:

    git log --pretty=format: --name-status | cut -f2- | sort -u
    

    Edit: Thanks to Jakub for teaching me a bit more in the comments, this version has a shorter pipeline and gives git more opportunity to get things right.

    git log --pretty=format: --name-only --diff-filter=A | sort -u
    

提交回复
热议问题