美文网首页Git
Git check for removed content in

Git check for removed content in

作者: JaedenKil | 来源:发表于2021-09-01 14:50 被阅读0次

In general, I'm sure some content was in a file, then got deleted sometime, I need to find out which commit made the change.

Say the content is "HelloWorld", the file is "DemoTest.json":

# To get only related commits
git log --oneline -G "HelloWorld" DemoTest.json

# Ignore case
git log -i --oneline -G "HelloWorld" DemoTest.json
# To get full contents of these commits
git log --follow -p -S "HelloWorld" DemoTest.json

Reference: How to grep (search) committed code in the Git history

相关文章

网友评论

    本文标题:Git check for removed content in

    本文链接:https://www.haomeiwen.com/subject/bpixwltx.html