我有两个存储库,它们位于两个不同的Git帐户上,完全独立的轨道上。关键是,这两个存储库是共享的东西。
基本上,我想将一个更改应用到另一个存储库中。问题是文件夹结构不同:
仓库S
RepoS
|--src
|--file1.js仓库D
RepoD
|--lib
|--src
|--file1.js因此,我在RepoS/src/file1.js中做了一个更改,并希望将其修补到RepoD\glib/src/file1.js中。
我试过:
git format-patch master -1 -o C:\Users\MyUser\Desktop
git am -3 <path-to-patch-created-in-line-before>它在第二行失败:
Applying: My change title
Using index info to reconstruct a base tree...
A src/file1.js
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.于是我试着(第二行):
git am -3 <path-to-patch-created-in-line-before> --directory=lib仍然失败的错误:
Applying: My change title
Using index info to reconstruct a base tree...
M lib/src/file1.js
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.我该怎么做?
发布于 2016-11-03 16:05:16
git am通常应用来自from stdin邮箱的补丁(注意<)。所以在你的情况下你得用
git am --directory=lib < patch-file.patch另一方面,git apply接受修补文件作为参数
git apply --directory=lib patch-file.patchhttps://stackoverflow.com/questions/40405097
复制相似问题