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

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


Solution 1:

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'

Solution 2:

The files managed by git are shown by git ls-files. Check out its manual page.