且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除/删除行后如何查找提交?

更新时间:2023-02-07 08:13:32

git log -c -S'missingtext'/path/to/file

git log 在默认情况下不显示合并提交的差异.尝试使用 -c -cc 标志.

git log doesn't show a diff for merge commits by default. Try the -c or --cc flags.

更多讨论/解释:
https://git-scm.com/docs/git-log
nabble.com

来自git-log文档:

From the git-log docs:

-c 使用此选项,合并提交的差异输出显示每个父项与合并结果之间的差异同时显示父级和父级之间的成对差异结果一次.此外,它仅列出了从所有父母那里修改.

-c With this option, diff output for a merge commit shows the differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time. Furthermore, it lists only files which were modified from all parents.

-cc 该标志隐含-c选项,并通过省略内容中不感兴趣的块来进一步压缩补丁输出.父母只有两个变体,合并结果会选择其中之一无需修改.

--cc This flag implies the -c option and further compresses the patch output by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification.