Git如何退出 rebase 模式

标签 git

<分区>

我做了一个 Git rebase,解决了冲突和强制推送,为什么它仍然是 rebase 模式,“dev|REBASE 2/3”?如何退出呢?我不想扔掉 rebase。

aaa@lenovo-pc MINGW64 ~/Documents/NetBeansProjects/GitTest1 (dev|REBASE 2/3)
$ git status
rebase in progress; onto f67f4c5
You are currently rebasing branch 'dev' on 'f67f4c5'.
  (all conflicts fixed: run "git rebase --continue")

nothing to commit, working tree clean

aaa@lenovo-pc MINGW64 ~/Documents/NetBeansProjects/GitTest1 (dev|REBASE 2/3)
$ git push --force origin dev
git@192.168.1.8's password:
Everything up-to-date

aaa@lenovo-pc MINGW64 ~/Documents/NetBeansProjects/GitTest1 (dev|REBASE 2/3)

谢谢

最佳答案

git rebase --abort

这应该可以解决问题。

更新:

git rebase 有点“原子”操作。你不能在中间完成它。将其视为交易。它要么完成,要么不完成。如果你认为你已经完成了,但是你的工作副本仍然处于“rebase”模式,那么这意味着你做错了什么,即:

  • 使用 git commit 手动添加提交
  • 如果是这样的话,并没有解决冲突。通常 rebase 是一个自动操作,您只需运行并观察,只有在冲突未解决时才会停止。

如何解决冲突?嗯,这是一个很好的单独问题。

关于Git如何退出 rebase 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41052102/

相关文章:

android - Android 应用程序的多个实例 - git 项目管理最佳方法

git - 在 Gitea 中更改管理员密码

git - 是否可以 git-checkout 单行而不是整个文件?

git - 让 Git 在提交时忽略 'No newline at end of file'

git - spring-cloud-config-server - 无法为主远程 : null merge 远程

git - 为什么 git 要求输入提交信息来解释为什么这个 merge 是必要的

git - 如何使 `git log --stat -- <path>` 显示选定提交中的 *所有* 文件?

git - 如何在 cygwin 中使用来自 git mergetool 的 BeyondCompare?

Anaconda 中的 Git 和 Jupyter Notebook

git - 尽管身份验证成功,但无法克隆 repo