ste*_*bot 14 git version-control blame git-blame
我如何在git中确定仍然存在的来自特定作者的所有行.比方说,Tony已经参与了我的项目,我想找到我的开发分支中仍然存在的所有行,并且来自Tony撰写的提交?
sid*_*ker 14
也许只是git blame FILE | grep "Some Name"
.
或者,如果您想以递归方式指责+搜索多个文件:
for file in $(git ls-files); do git blame $file | grep "Some Name"; done
Run Code Online (Sandbox Code Playgroud)
或者,如果您正在寻找与上述内容不同的输出,请考虑更新问题以更明确地了解您想要的输出.
注意:我最初建议使用下面的方法,但是你可能遇到的问题是它也可能在工作目录中找到git实际上没有跟踪的git blame
文件,因此这些文件和打破循环.
find . -type f -name "*.foo" | xargs git blame | grep "Some Name"
Run Code Online (Sandbox Code Playgroud)
Jes*_*aur 11
sideshowbarker大多是正确的,但固定的第二个命令是:
find . -type f -exec git blame {} \; | grep "Some Name"
Run Code Online (Sandbox Code Playgroud)
虽然我更愿意这样做:
for FILE in $(git ls-files) ; do git blame $FILE | grep "Some Name" ; done | less
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5001 次 |
最近记录: |