本文介绍了Git历史记录 - 按关键字查找丢失的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果有任何方法可以找到它的修订版本号,那么它在哪里是最后一次没有购买FishEye?

解决方案

这可以通过解决( -S )选项

  git log -SFoo  -  path_containing_change 

(您甚至可以添加时间范围: - since = 2009.1.1 --until = 2010.1.1 )

  -S< string> 





  diffcore-pickaxe 








2014年更新:

从那以后,您可以做到(从的):

  git log -p --all -S'搜索字符串'
git log -p --all -G'匹配正则表达式'





  git branch -a --contains 8beeff00d 


I had somewhere in my Git repository a line containing word "Foo" a couple hundreds commits before.

If there is any way to find its revision number where it was the last time without buying FishEye?

解决方案

That may be addressed by the pickaxe (-S) option of gitlog

 git log -SFoo -- path_containing_change

(you can even add a time range: --since=2009.1.1 --until=2010.1.1)

-S<string>
diffcore-pickaxe


Update 2014:

Since then, you can do (from nilbus's answer):

git log -p --all -S 'search string'
git log -p --all -G 'match regular expression'
git branch -a --contains 8beeff00d

(I reference that last command in "How to list branches that contain a given commit?")

这篇关于Git历史记录 - 按关键字查找丢失的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 02:21