【问题标题】:What does `git ls -files` output? [duplicate]`git ls -files` 输出什么? [复制]
【发布时间】:2019-06-13 05:44:53
【问题描述】:
$ 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

输出中的第一列是什么意思?

使用--stage,它会输出索引中的文件。 没有--stage,会输出什么文件?

$ git ls-files 
README
branchfile
common/placeholder
reader/placeholder
writer/placeholder

【问题讨论】:

  • 第一列显然是文件模式。
  • 最好单独提出关于git ls-files --stagegit ls-files 的问题,而不用--stage,因为在某些情况下输出是针对不同的文件集的。或者只是仔细阅读 Git 自己的文档。

标签: git


【解决方案1】:

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

git ls-files 只输出文件名,除非 --stage 在 它输出哪种情况:

[tag] 模式对象暂存文件

第一列是上述情况下的模式 你可以找到更多关于如何阅读模式here

没有--stage,它会列出所有跟踪的文件

【讨论】:

  • 谢谢。 100644 翻译成什么?我的第二个问题呢?
猜你喜欢
  • 2021-08-20
  • 2015-03-25
  • 2015-10-12
  • 2020-08-06
  • 2023-03-27
  • 2017-07-26
  • 2021-06-19
  • 2014-11-12
  • 1970-01-01
相关资源
最近更新 更多