【发布时间】:2014-05-24 20:54:06
【问题描述】:
我需要在我的 repo 中获取一些与 repo 的基础无关的差异,而是相对于给定的基础或给定的路径。
默认情况下我得到:
git diff
diff --git a/path/to/file b/path/to/file
index 0cc125e..9bf911e 100644
--- a/path/to/file
+++ b/path/to/file
但我想要的是这样的:
git diff --prefix=/new/path/to
diff --git a/new/path/to/file b/new/path/to/file
index 0cc125e..9bf911e 100644
--- a/new/path/to/file
+++ b/new/path/to/file
我查看了 --relative 选项(不是我要找的), --src/dst-prefix (这些只能更改“a”或“b”部分。我错过了一些基本的东西吗?
【问题讨论】:
-
它们是否都与 repo 的某些部分相关?如果没有,为什么不使用 vimdiff 或 meld 代替?
标签: git diff patch git-diff difference