git log -L without diff

前端 未结 3 1421
醉酒成梦
醉酒成梦 2021-01-06 07:28

I\'m trying to use git log -L ,: but I would like to have very limited output (actually just hashes). While --pretty pri

3条回答
  •  悲哀的现实
    2021-01-06 08:16

    one grep solution is to pipe the output to grep to only print lines matching a commit:

    git log -L 10,11:example.txt | grep 'commit \w' -A 4
    

    grep matches the first line of each log entry and the prints the next 4 lines with the -A flag

    It's a bit verbose though. Would love to hear if anyone has a better solution!

提交回复
热议问题