How to list versioned files in git?

后端 未结 2 1355
忘了有多久
忘了有多久 2021-02-02 08:13

I would like to list the versioned files in the root directory of a git repository. To do the same thing in bazaar, you run:

bzr ls --versioned --non-recursive
<         


        
2条回答
  •  忘了有多久
    2021-02-02 08:48

    I do not know what "bzr ls --versioned --non-recursive" does, but I suspect that it is either

    • "git ls-tree --name-only HEAD" (like Charles Bailey wrote), which lists files at given revision, and by default is non-recursive

    or

    • "git ls-files" (perhaps additionally with --cached and --exclude-standard options), which lists specified kinds of files (by default it is files that are in index), and is recursive (and currently there is no way to turn off being recursive, as far as I know).

提交回复
热议问题