Git能显示选定行的历史记录吗? [英] Can Git show history for selected lines?

查看:94
本文介绍了Git能显示选定行的历史记录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个大文件,在中间的某个地方,有一个我知道已经修改了几次的函数。 git annotate blame 会显示每行的最近提交,但如果我是对的,它会显示<只是最近的一个,而不是其他影响该行的提交列表。

那么是否有Git中的一个命令,我可以说像显示我在文件XYZ中提交受影响的行250..260

解决方案

Git中的一条评论中 - 我如何查看方法/函数的更改历史记录?

  git gui blame< file> 

然后右键点击一行并选择 Blame Parent Commit 做什么我需要。


I have a large file where, somewhere in the middle, there is a function that I know has been modified several times. git annotate or blame will show the most recent commit for each line but if I'm right, it will show only the most recent one, not a list of other commits that affected that line before.

So is there a command in Git where I could say something like show me commits that affected lines 250..260 in file XYZ?

解决方案

As suggested in one of the comments in Git - how do I view the change history of a method/function?, doing

git gui blame <file>

and then right-clicking a line and selecting Blame Parent Commit does what I need.

这篇关于Git能显示选定行的历史记录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆