List all the files in a git repository

If you want to list all files for a specific branch, e.g. master:

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

-d Show only the named tree entry itself, not its children.
-r Recurse into sub-trees.

You can specify HEAD instead of master to get the list for any other branch you might be in.

If you want to get a list of all files that ever existed:

$ git log --pretty=format: --name-only --diff-filter=A | sort -