我需要获取存储库中与存储库基础不相关,而是相对于给定基础或给定路径的一些差异。
默认情况下,我会得到:
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”部分)。我是否漏掉了一些基本的东西?