Using command line git, how can I make git show a list of the files that are being tracked in the repository?
ls-tree will output all the versioned files.
--full-tree makes the command run as if you were in the repo's root directory. -r recurses into subdirectories. Combined with --full-tree, this gives you all committed, tracked files.
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'
The files managed by git are shown by git ls-files
. Check out its manual page.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With