Git: discover which commits ever touched a range of lines

前端 未结 6 422
情话喂你
情话喂你 2020-11-29 19:16

I\'m having trouble figuring out how to use git blame for getting the set of commits that ever touched a given range of lines. There are similar questi

6条回答
  •  生来不讨喜
    2020-11-29 19:46

    Not sure what you want to do, but maybe git log -S can do the trick for you:

    -S
        Look for differences that introduce or remove an instance of . 
        Note that this is different than the string simply appearing
        in diff output; see the pickaxe entry in gitdiffcore(7) for more
        details.
    

    You can put in string the change (or part of the change) you are trying to follow and this will list the commits that ever touched this change.

提交回复
热议问题