git log --full-diff 的作用
原始文档比较拗口,摘选如下:
--full-diff
Without this flag,git log -p ...
shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch the specified paths; this means that "…" limits only commits, and doesn’t limit diff for those commits.
说人话,假设你提交了一个 Commit,这个 Commit Z 修改了 文件 A 和 B。
git log without full diff
不带 --full-diff
参数,则在相关 Commits 中只显示特定文件的 Diff,也就是说只显示 A 的变更。
git log -p -- src/components/cmdb/components/A.vue
git log with full diff
带 --full-diff
参数,则在相关 Commits 中除了特定文件的 Diff,还显示这些 Commits 修改的其他文件的 Diff,比如 B 的变更。
git log -p --full-diff -- git log -p -- src/components/cmdb/components/A.vue