Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 10
    git ls-files instead of git ls-tree -r master --name-only is certainly simpler.
    – karatedog
    Commented Oct 22, 2013 at 8:14
  • 1
    Sorry but my edit wasn't invalid. In current git there is no git-ls-files binary. There is the git binary with the ls-files command. The link to the documentation is correct in content, but technically for an outdated binary.
    – JonnyJD
    Commented Jan 11, 2014 at 3:09
  • @JonnyJD, probably marked invalid because your edit should be a comment.
    – Ascherer
    Commented Oct 12, 2014 at 20:16
  • 2
    @JonnyJD All Git man-pages are named as git-commit, git-init, git-ls-files, etc. even though the programs are actually subcommands. There never was a git-ls-files binary, most likely. The reasoning is that it's consistent with the external subcommand mechanism, which allows you to register a git foo command by writing a git-foo binary. Commented Jul 19, 2017 at 16:50
  • 1
    This is indeed simpler, but on the other hand git ls-tree lets you specify a "tree-ish" (i.e. a branch, tag or commit), whereas git ls-files doesn't offer that option and works therefore only on HEAD. Commented Dec 15, 2020 at 23:10