本质上,我想做的是我们通常使用Web界面所做的相同的事情。我知道如何git blame使用Web界面说bitbucket或github,但是如何使用git CLI做同样的事情?到目前为止,我到目前为止:
git grep <line of code that I am interested to see the blame>。获取文件列表,然后找到我感兴趣的文件。git blame <on file of interest>。显示谁做了什么并提交哈希。发布后,我偶然发现了这个http://zsoltfabok.com/blog/2012/02/git-blame-line-history/,因此我将其发布在这里以供参考。这些步骤是:
git blame -L <starting line number>,<ending line number> <filename>。(即行号用逗号分隔,没有空格)git show <commit hash> 会告诉您您需要了解的内容。| 归档时间: |
|
| 查看次数: |
2939 次 |
| 最近记录: |