Git如何退出rebase模式

use*_*666 3 git

我做了一个Git rebase,修复了冲突和强制推力,为什么它仍然是rebase模式,"dev | REBASE 2/3"?怎么退出呢?我不想丢掉这个篮板.

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

谢谢

Xob*_*obb 26

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

这应该为你做的伎俩.

UPD:

git revert有点"原子"操作.你无法在中间完成它.将其视为交易.它要么完成要么不完成.如果你认为你已经完成了,但是你的工作副本仍处于"rebase"模式而不是意味着你做错了什么,即:

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

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

  • git rebase --quit也可以,跳出当前分支。 (2认同)
  • 我喜欢你的回答@NickTsai。就我而言,我正在处理较旧的项目,突然我处于“变基模式”。我不知道之前发生了什么,所以我做了你的回答,我可以像平常一样工作 (2认同)