by shigemk2

当面は技術的なことしか書かない

git ls-files -s

[<tag> ]<mode> <object> <stage> <file> っていう表示。

$ git ls-files -s github/Repository.py
100644 1d4514f5745add8ee1d52e062b7a61021b25aedd 0 github/Repository.py

Git - git-ls-files Documentation

stage numberについては、基本ゼロだけどコンフリクトが発生したときに1 2 3に分かれる、みたいな解釈だと思われる。

Normally, only 0 is used since this represents the state of the current working tree. However, if a merge conflict arises, then the index is used to disambiguate the state of the files at each level. If you have a conflict, then stage 0 is used to represent the current working tree, stage 1 is used for your change, then stage 2 and 3 for the other differences.

Git Tip of the Week: Index Revisited - AlBlue’s Blog

なお、objectがGitHub APIがよく求めるファイルのsha。