Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
git log -G搜索包含表达式的差异的历史记录,但它仅输出找到的每个差异的提交消息。
git log -G
有没有办法做到这一点,但也输出差异的实际内容?
使用 -p 选项:
git log -p -G mysearch
嗯,有git diff。尝试阅读该 ( man git-diff) 的说明。
git diff
man git-diff
您可以使用提交 ID 和文件名来比较特定的事物,例如:
git diff <commit_id> <filename> <other_commit_id> <filename>
这将向您显示在指定提交时给出的文件的差异。