Git rebase:所有冲突都修复了,但是Git rebase—continue失败,没有命名任何导致问题的文件.&l



我正在把我的分支重新建立在master上。这是我以前从未遇到过的奇怪情况。我解决了所有的冲突,并通过git add标记了解决。这是git识别的,它告诉我去run "git rebase --continue",但是当我运行这个命令时,它的响应是You must edit all merge conflicts and then mark them as resolved using git add

以下是上述交互的控制台输出,其中编辑了不相关的部分。注意,git status输出显示(all conflicts fixed: run "git rebase --continue"),但是在运行该命令时,有一条消息没有提示问题。

%> git status
interactive rebase in progress; onto <commit-id>
Last commands done (49 commands done):
pick <commit-id> ....
pick <commit-id> ....
(see more in file .git/rebase-merge/done)
Next commands to do (38 remaining commands):
pick <commit-id> ....
pick <commit-id> ....
(use "git rebase --edit-todo" to view and edit)
You are currently rebasing branch 'branch-1' on '<commit-id>'.
(all conflicts fixed: run "git rebase --continue")
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
....
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
....
%> git rebase --continue
You must edit all merge conflicts and then
mark them as resolved using git add
%> git --version
git version 2.35.1.windows.2

我错了。被列为not staged for commit的文件没有任何冲突,但它是一个Java源文件,它确实在一行的末尾有一些额外的字符。这些字符是我本想在另一个窗口中输入的,但我的光标在IDE中,它们被添加到这个文件中。

删除那些多余的不需要的字符修复了这个问题,我现在可以继续了。

最新更新