2016-02-01 35 views
1

我覺得這個答案應該很簡單,但是我正在尋找它的路徑並沒有解決問題。下面是從一個git log命令的輸出示例(有一些選項)(文件名稱已更改爲保護無辜者):在git log的--name-status列表中,狀態標籤的後綴是什麼?

$ 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 

什麼是070後,在C指的是在第一項的狀態的一部分?

回答

1
man git-log 

和搜索--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. 

和搜索--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. 

http://git-scm.com/docs/git-diff

狀態字母C和R總是弗洛以分數結尾(表示移動或複製的來源和目標之間的相似百分比)。狀態字母M後可以跟一個文件重寫的分數(表示不相似性的百分比)。

+1

哈哈,好的。我看過前兩個引號,但什麼奧術咒語將你從那裏帶到了git-diff?僅僅因爲這個選項被稱爲「diff-filter」? –

相關問題