我有A->B->C致力于公共回购,A->D->E致力于本地回购,所有内容都在主分支上。
我想通过运行"git pull--rebase"将本地更改的基础重新设置为C(即A->B->C->D->e(。
我收到了标准消息:
CONFLICT (content): Merge conflict in README4.md
error: Failed to merge in the changes.
Patch failed at 0001 [basic]Added X4.createdAt to README4.md
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".
我运行"gitmergetool"来修复冲突,然后运行"git-rebase--continue"。结果是打印了帮助菜单,而不是让我去解决下一个冲突。
C:Tempbasic>git rebase --continue
usage: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] [<upstream>]
[<branch>]
or: git rebase [-i] [options] [--exec <cmd>] [--onto <newbase>] --root [<bran
ch>]
or: git-rebase --continue | --abort | --skip | --edit-todo
Available options are
-v, --verbose display a diffstat of what changed upstream
-q, --quiet be quiet. implies --no-stat
--autostash automatically stash/stash pop before and after
有人能告诉我我做错了什么吗?我应该使用主分支和第二个分支来重新基础,还是问题和Windows的GIT有关?我可以将我的本地更改与公共存储库上的更改合并,但更喜欢将本地更改重定基准/快进到公共存储库中的最新更改。
在修复合并冲突后尝试此操作。
git-rebase --continue
您可以从终端输出中看到usage
or: git-rebase --continue | --abort | --skip | --edit-todo
问题似乎是Windows GIT特有的。在Linux上执行相同的步骤可以成功地重新建立基础。
如果您确实解决了冲突
- 例如gitdiff(或status(,以查看冲突的更改
- 编辑有问题的文件
- git添加更改的文件S(好点用户376507(
您提到使用mergetool,是否保存了更改?