Vim逃亡:Gblame reblame选项

Jon*_*ink 6 git vim vim-fugitive git-blame

我最近一直在使用Fugitive的Gblame,但不太明白"reblame"的作用.

有人可以更清楚地描述这些选项的作用:

 -     reblame at commit
 ~     reblame at [count]th first grandparent
 P     reblame at [count]th parent (like HEAD^[count])
Run Code Online (Sandbox Code Playgroud)

Pet*_*ker 10

将reblame视为导航到提交,然后对您的文件或者运行责备 git blame <commit> -- <file>

  • -最简单的情况.使用光标下的提交并重新启动文件.
  • ~ 相当于跑步 git blame <rev>~[count] -- <file>
  • P 相当于跑步 git blame <rev>^[count] -- <file>

对于常见情况,即不[count],~并且P是等价的.(注意[count]默认为1)

快速修订教程取自git help gitrevisions:

Here is an illustration, by Jon Loeliger.
Both commit nodes B and C are parents of commit node A.
Parent commits are ordered left-to-right.

G   H   I   J
 \ /     \ /
  D   E   F
   \  |  / \
    \ | /   |
     \|/    |
      B     C
       \   /
        \ /
         A
A =      = A^0
B = A^   = A^1     = A~1
C = A^2  = A^2
D = A^^  = A^1^1   = A~2
E = B^2  = A^^2
F = B^3  = A^^3
G = A^^^ = A^1^1^1 = A~3
H = D^2  = B^^2    = A^^^2  = A~2^2
I = F^   = B^3^    = A^^3^
J = F^2  = B^3^2   = A^^3^2
Run Code Online (Sandbox Code Playgroud)

要了解有关git修订符号的更多信息,请参阅:

有关更多帮助,git blame请参阅git help blame

  • 谢谢,这一行有助于我清楚:"想想reblame导航到提交然后对你的文件负责" (2认同)