在 11 月份有大约 133 次提交的项目,我已经克隆了该项目并在 50 次提交之前创建了一个新的 repo,这意味着:
A----B----C----D----E
Cloned New Repo from C
\__ C
现在新仓库中大约有 15-20 个提交,但是没有提交被推送到旧仓库,但是在编码许多文件并在内部进行了更改时。
A----B----C----D----E
Cloned New Repo from C
\__ C----C1----C2---C3---C4
现在我想将这两个 repo 合并为一个:
A----B----C----D----E----C1----C2---C3---C4
搜索互联网后得到一些命令并尝试与以下合并:
git --git-dir=../<some directory>/.git|
format-patch -k -15 --ignore-space-at-eol --stdout <commit SHA>|
git am -k -3
它给出了第一次提交的confilts并成功解决了它:
git mergetool
gm am --continue
显示错误:
Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Cannot fall back to three-way merge.
Patch failed at 0002 XXXXXXX
The copy of the patch that failed is found in:
/xxxxxx/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".