[Git] List files on a specific branch

Created on November 28, 2026

You can use git ls-tree as shown below to list the files on the hoge branch, much like git ls-files lists files.

git ls-tree -r --name-only hoge
  • -r includes files in subdirectories as well as in the current directory.
  • --name-only displays only file names.
Git