git log排除重命名 [英] git log exclude renames
本文介绍了git log排除重命名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以列出提交文件,即使它已被重命名或移动
git log --follow foo。 sh
然而,我想跟随文件,但只列出提交文件的地方实际上改变了类似于
git log --follow --exclude-renames foo.sh
-name-status --oneline foo.sh | sed'h; N; / \ nR / d; g'
- 复制提交行以存放空间
- 在第二行读取 如果以
> R 被找到,删除模式空间并开始下一个循环,
else复制保留空间到模式空间
感谢 jthill
I can list commits for a file, even if it has been renamed or moved
git log --follow foo.sh
However, I would like to "follow" the file, but only list commits where the file was actually changed. Something like
git log --follow --exclude-renames foo.sh
解决方案
git log --follow --name-status --oneline foo.sh | sed 'h;N;/\nR/d;g'
- copy commit line to hold space
- read in second line
- if line starting with
R
is found, delete pattern space and start next cycle, else copy hold space to pattern space
thanks to jthill
这篇关于git log排除重命名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文