在 git log 的 --name-status 列表中,状态标记后缀的数字是什么?

A. *_*son 6 git

我觉得这个问题的答案应该很简单,但是我要寻找的路径并没有找到答案。这是 git log 命令的示例输出(带有一些选项)(文件名已更改以保护无辜者):

$ git log --pretty=%H --follow --name-status -- plans/some_file
997efbccfb0c54f95dd3c22498e47d2971caff0d

C070    plans/some_files_previous_name     plans/some_file
9a265ea5f5b232ec778fb0193ff2f48b3ea25cdf

A       plans/some_files_previous_name
eadecec4b743cc33e16a4eabf68e35cac62c0fa0

D       plans/some_files_previous_name
dc408368cf6f80c841f94f58e4c5dc3283929483

M       plans/some_files_previous_name
8feb7d99b92a993cd8c95506c8d419e4f59d513e
Run Code Online (Sandbox Code Playgroud)

第一个条目的状态部分中 C 后面的 070 是什么意思?

kev*_*hoi 5

man git-log
Run Code Online (Sandbox Code Playgroud)

寻找--name-status让我们

   --name-status
       Show only names and status of changed files. See the description of the
       --diff-filter option on what the status letters mean.
Run Code Online (Sandbox Code Playgroud)

搜索--diff-filter给了我们

   --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]
       Select only files that are Added (A), Copied (C), Deleted (D), Modified (M),
       Renamed (R), have their type (i.e. regular file, symlink, submodule, ...)
       changed (T), are Unmerged (U), are Unknown (X), or have had their pairing
       Broken (B). Any combination of the filter characters (including none) can be
       used. When * (All-or-none) is added to the combination, all paths are selected
       if there is any file that matches other criteria in the comparison; if there is
       no file that matches other criteria, nothing is selected.
Run Code Online (Sandbox Code Playgroud)

以及来自http://git-scm.com/docs/git-diff

状态字母 C 和 R 后面始终跟有分数(表示移动或复制的源和目标之间的相似性百分比)。状态字母 M 后面可能会跟有文件重写的分数(表示不相似性的百分比)。

  • 哈哈,好吧。我看过前两句话,但是是什么神秘的咒语让你从那里转向 git-diff 呢?仅仅因为该选项称为“diff-filter”? (3认同)