1
$ git ls-files --stage
100644 d88791dfb9168a50c6b91c0256dafc00c4c882f1 0   README
100644 fde330c39bee930b2de3410844097b416e7d9af4 0   branchfile
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0   common/placeholder
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0   reader/placeholder
100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0   writer/placeholder

What does the first column in the output mean?

With --stage, it outputs the files in the index. WIthout --stage, what files will be outputted?

$ git ls-files 
README
branchfile
common/placeholder
reader/placeholder
writer/placeholder
Tim
  • 1
  • 122
  • 314
  • 481
  • 1
    First column is apparently file mode. – iBug Jan 18 '19 at 23:46
  • https://stackoverflow.com/search?q=%5Bgit%5D+ls-files+--stage+mode – phd Jan 19 '19 at 00:54
  • It might be better to ask separate questions about `git ls-files --stage` vs `git ls-files` without `--stage`, since the output is for different sets of files in some cases. Or just read Git's own documentation carefully. – torek Jan 19 '19 at 04:24

1 Answers1

2

https://git-scm.com/docs/git-ls-files#_output

git ls-files just outputs the filenames unless --stage is specified in which case it outputs:

[tag] mode object stage file

the first column is a mode in the mentioned case you can find more about how to read the mode here

without the --stage it lists all the tracked files

Community
  • 1
  • 1
Yuri G.
  • 3,427
  • 1
  • 11
  • 26