正在进行改革.无法提交.如何进行或停止(中止)?

Jos*_*ers 115 git git-rebase

当我跑:

git status
Run Code Online (Sandbox Code Playgroud)

我看到了这个:

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
Run Code Online (Sandbox Code Playgroud)

当我做:

ls `git rev-parse --git-dir` | grep rebase || echo no rebase
Run Code Online (Sandbox Code Playgroud)

我明白了:rebase-apply

我不能承诺起源.

git branch
Run Code Online (Sandbox Code Playgroud)

显示:

* (no branch, rebasing master)
  develop
  master
Run Code Online (Sandbox Code Playgroud)

我被卡住了.我不知道该怎么办?是否真的需要这么长时间才能改变?git rebase --continue什么都不做 我没有任何git状态..我只是在等待rebase.我能做什么?

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".
Run Code Online (Sandbox Code Playgroud)

git add.没什么.

Mat*_*Moy 220

Rebase不会在后台发生."正在进行的改变"意味着你开始了一次变革,并且因为冲突而变质被打断了.你必须恢复rebase(git rebase --continue)或中止它(git rebase --abort).

作为来自git rebase --continue建议的错误消息,您要求git应用导致空补丁的补丁.最有可能的是,这意味着补丁已经应用,您想要使用它git rebase --skip.

  • git rebase --skip做到了! (4认同)
  • 这个文件非常糟糕,它不断重复你的'git rebase --continue',你最终会以无限的方式说出来. (3认同)
  • 好的,然后“它变基-继续不执行任何操作”是不准确的。您应该已经编写了“ git rebase-继续按照以下说明继续错误...”以获取帮助。 (2认同)

小智 16

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

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

类型:

git rebase --quit
Run Code Online (Sandbox Code Playgroud)

  • 谢谢你!这正是我的问题。 (2认同)

Ani*_*non 14

  • 第一步:继续git rebase --continue

  • 第 2 步:然后修复 CONFLICTSgit add .

  • 回到第 1 步,现在如果它说no changes ..然后运行git rebase --skip并返回到第 1 步

  • 如果你只是想退出 rebase run git rebase --abort

  • 完成所有更改后,运行git commit -m "rebase complete"并完成。


注意:如果您不知道发生了什么,只想回到 repo 所在的位置,那么只需执行以下操作:

git rebase --abort
Run Code Online (Sandbox Code Playgroud)

阅读关于 rebase:git-rebase doc


Sch*_*eis 6

你告诉你的存储库要改变.看起来你正在进行提交(由SHA 9c168a5识别),然后做了git rebase mastergit pull --rebase master.

您正在将分支主服务器重新定位到该提交上.你可以通过结束rebase git rebase --abort.这会在你开始变基之前回到你所处的状态.


Dan*_* K. 6

我陷入了“恢复原状”状态,

On branch master
Your branch is up to date with 'origin/master'.

You are currently rebasing.
  (all conflicts fixed: run "git rebase --continue")

nothing to commit, working tree clean
Run Code Online (Sandbox Code Playgroud)

但奔跑git rebase --skip屈服了error: could not read '.git/rebase-apply/head-name': No such file or directory

跑步有rm -fr ".git/rebase-apply"帮助。

注意:当然,仅当您不关心重新基准设置或不愿再使用以前的重新基准设置时,才执行此操作。


jse*_*ars 5

我最近进入了这种状态。解决了在变更基准期间的冲突之后,我提交了更改,而不是运行git rebase --continue。这会产生与运行git statusand git rebase --continue命令时所看到的相同消息。我通过运行来解决了该问题git rebase --abort,然后重新运行了变基。可能还会跳过重新设置基准,但是我不确定会导致什么状态。

$ git rebase --continue
Applying: <commit 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 status
rebase in progress; onto 4df0775
You are currently rebasing branch '<local-branch-name>' on '4df0775'.
  (all conflicts fixed: run "git rebase --continue")

nothing to commit, working directory clean
Run Code Online (Sandbox Code Playgroud)