当我跑步时:

git status

我看到了这个:

rebase in progress; onto 9c168a5
You are currently rebasing branch 'master' on '9c168a5'.
(all conflicts fixed: run "git rebase --continue")
nothing to commit, working directory clean

当我这样做的时候:

ls `git rev-parse --git-dir` | grep rebase || echo no rebase

我明白了:rebase-apply

我不能确定起源。

git branch

显示:

* (no branch, rebasing master)
  develop
  master

我卡住了。我不知道该怎么办?真的需要这么长时间来调整基地吗?Git rebase—continue不做任何事情。我没有任何东西在git状态..我只是在等待重新调整。我该怎么办?

UDATE: 这是git rebase——continue的输出

Applying: no message
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this 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".

Git添加。无关。


当前回答

第一步:继续git rebase——继续 步骤2:修复冲突,然后git添加。 回到第1步,现在如果它说没有变化..然后运行git rebase—skip并返回步骤1 如果你只是想退出rebase运行git rebase—abort 一旦所有的修改都完成了,运行git commit -m "rebase complete"就完成了。


注意:如果你不知道发生了什么,只是想回到回购的位置,那么只需执行: 撤退,放弃

阅读有关rebase: git-rebase文档

其他回答

如果git rebase -abort不工作,你仍然得到

错误:无法读取。git/rebase-apply/head-name':没有这样的文件或目录

类型:

git rebase --quit

Rebase不会在后台发生。“rebase in progress”意味着你开始了一个rebase,而这个rebase因为冲突而中断了。你必须重新开始 (git rebase—continue)或中止它(git rebase—abort)。

正如git rebase——continue的错误消息所示,您要求git应用一个补丁,结果是一个空补丁。很有可能,这意味着补丁已经被应用了,你想使用git rebase -skip删除它。

你告诉你的存储库要改基。看起来你是在提交(由SHA 9c168a5识别),然后git rebase master或git pull -rebase master。

你是在将分支master重新基于那个提交。你可以通过git rebase——abort来结束rebase。这会让你回到你开始变基之前的状态。

我也面临着同样的问题,在我的情况下,当我试图重新建立基础时,我得到了冲突,一旦我解决了所有的冲突,并试图添加一个提交消息,但它在我的客户端编辑器中显示这个错误(VS Code)

为了解决这个问题,我们需要触发这个命令git commit -C HEAD@{1}

它将指向你在做rebase之前的提交

有时候在VS代码中仍然会显示rebase正在进行,为了解决这个问题,你需要触发这个命令rm -rf .git/REBASE_HEAD

rm -rf .git/REBASE_HEAD将从您的本地文件中删除“REBASE_HEAD”

第一步:继续git rebase——继续 步骤2:修复冲突,然后git添加。 回到第1步,现在如果它说没有变化..然后运行git rebase—skip并返回步骤1 如果你只是想退出rebase运行git rebase—abort 一旦所有的修改都完成了,运行git commit -m "rebase complete"就完成了。


注意:如果你不知道发生了什么,只是想回到回购的位置,那么只需执行: 撤退,放弃

阅读有关rebase: git-rebase文档