List Tracked Files in a Git Repository with ls-files
List tracked files with git ls-files. A name with non-ASCII bytes is printed quoted with octal escapes unless core.quotePath is off or -z is used.
You want the list of files Git tracks, and the one with an accented name comes out as something unreadable.
git init -q repo && cd repo
echo a > a.txt
echo b > 'é.txt'
git add .
git ls-files
echo ---
git -c core.quotePath=off ls-files
echo ---
git ls-files -z | tr '\0' '\n'a.txt
"\303\251.txt"
---
a.txt
é.txt
---
a.txt
é.txtgit ls-files prints the paths in the index, relative to the current directory. By default Git quotes any name that has bytes above 127 in C style, giving octal escapes, to keep one path on one line, as the core.quotePath entry in the git config manual explains. Turning it off prints the real name, and -z ends each path with a NUL byte instead, which is the only fully safe form for scripts.
The list covers the index, so a file you deleted but did not stage still shows, and untracked files never appear; add -o --exclude-standard for those. Run from a subdirectory the command lists only that subtree. git ls-tree -r HEAD --name-only lists what is committed.