Listing files committed to a Git repository

Files currently committed to a Git repository

This will show all files committed to the current branch.

git ls-tree --full-tree -r --name-only HEAD

Credit goes to an answer on StackOverflow for this solution.

All files that have ever been committed to a Git repository

This will show all files that have ever been committed to the current branch. This is useful for checking if sensitive files are in a Git's history.

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

Credit goes to an answer on StackOverflow for this solution.