How can I get a list of all the files in my Git repository on my local machine? Is there a way to do this via the command line?
If it matters, my machine is a Macbook Pro.
Thanks in advance!
git ls-tree --full-tree -r --name-only HEAD
This will list all the files that have been committed to the repo.
--full-tree: tells Git to include the entire directory. As if the command was ran from your project root.
-r: tells Git to recursively go through each directory in the repo.
--name-only: tells Git to only include the file paths.
HEAD: then name of the branch you want information for. This can be changed to
List the files for a specific branch:
git ls-tree -r master --name-only
master with the name of the branch you want to examine.
This will list all the files that have existed in your repo:
git log --pretty=format: --name-status | cut -f2- | sort -u