例子 使用 git diff 的格式比较不在仓库中的文件 1 git diff --no-index -- A B 还可加 git diff 的其他选项(如指定 context 行数等等) fetch all history after cloning with --depth=1 2 git pull --unshallow Footnotes https://stackoverflow.com/a/17433969/10974106 ↩ https://stackoverflow.com/a/29270131/10974106 ↩