Git - how do I view the change history of a method/function?

后端 未结 7 1437
我寻月下人不归
我寻月下人不归 2020-11-28 19:55

So I found the question about how to view the change history of a file, but the change history of this particular file is huge and I\'m really only interested in the changes

相关标签:
7条回答
  • 2020-11-28 20:33
    1. Show function history with git log -L :<funcname>:<file> as showed in eckes's answer and git doc

      If it shows nothing, refer to Defining a custom hunk-header to add something like *.java diff=java to the .gitattributes file to support your language.

    2. Show function history between commits with git log commit1..commit2 -L :functionName:filePath

    3. Show overloaded function history (there may be many function with same name, but with different parameters) with git log -L :sum\(double:filepath

    0 讨论(0)
提交回复
热议问题