How do I display directories first using git ls-files

123 views Asked by At

I am looking for something similar to the --group-directories-first parameter of ls for the command

git ls-files

Normally, the output is alphabetically sorted and looks like this:

anotherfile.c
directory/file.c
file.c

I want it to look like this:

directory/file.c
anotherfile.c
file.c
1

There are 1 answers

0
VonC On

That does not seem to be supported (or even discussed in the Git mailing list)

Only some kind of command alias/output processing would return the desired output (like calling the command twice, once including "/" for getting all the path with folders, once excluding "/" for getting files only)