The command git show is extremely useful, including for listing directories, but its output in listing a directory causes some problems. For example, consider the following.
user@machine$ git show HEAD:src/
tree HEAD:src/
file0
dir0/
file1
etc/
...
The problem, here, is that it prints tree HEAD:src/ and a blank line. I could easily split on the blank line, and take only the directory listing, but this seems needlessly complex. I cannot use any other system tools, like tr or similar. I can only use git.
Thank you all!
Try
ls-treecommand instead:-rinstructsls-treeto be recursive and--name-onlysimplifies output.