How can I make git show a list of the files that are being tracked?

前端 未结 4 522
误落风尘
误落风尘 2020-12-04 04:12

Using command line git, how can I make git show a list of the files that are being tracked in the repository?

4条回答
  •  长情又很酷
    2020-12-04 05:12

    If you want to list all the files currently being tracked under the branch master, you could use this command:

    git ls-tree -r master --name-only
    

    If you want a list of files that ever existed (i.e. including deleted files):

    git log --pretty=format: --name-only --diff-filter=A | sort - | sed '/^$/d'
    

提交回复
热议问题