git · Git
报错原文
You are currently rebasing branch 'feature' on '8a3f21c'.
这是什么意思
一次 rebase 开始后停在了中途,HEAD 停在一个临时状态上,而不是你的分支上。你会在 rebase 期间发生冲突之后,或者 git rebase -i 在 edit、break 处停下之后看到这一行——你没把它做完就去干别的了。解决冲突后 git add,再用 git rebase --continue 继续;如果打算丢掉那个提交就用 --skip。git rebase --abort 会精确回到 rebase 开始之前的位置,已提交的东西一点不丢,但你到目前为止手工解决的冲突会一起消失。
怎么修
git rebase --abort- 来自
- git
- Git
- 29
git 的错误几乎都是一种拒绝,意思是「在当前状态下做那件事会丢掉东西」;fatal: 表示它什么都没改就停了,而真正的解决办法往往在第一行下面的 hint: 行里。
怎么读报错
- 从第一行往下读。越往下越是工具内部的事,起因通常写在最上面。
- 有文件名和行号就从那里查——不是栈顶那一帧,而是最上面那条提到你自己写的文件的行。
- 把报错原文照样去搜,但先去掉你自己的路径和变量名,正是那些让搜索匹配不上。
- 同一种情况在不同版本里措辞不同。结果不对头,就把版本号一起加进查询。
- 粘贴修法之前,先确认它会丢掉什么。这里面有些是不能撤回的。
常见问题
Q. “You are currently rebasing branch 'feature' on '8a3f21c'.” 是什么意思?
一次 rebase 开始后停在了中途,HEAD 停在一个临时状态上,而不是你的分支上。你会在 rebase 期间发生冲突之后,或者 git rebase -i 在 edit、break 处停下之后看到这一行——你没把它做完就去干别的了。解决冲突后 git add,再用 git rebase --continue 继续;如果打算丢掉那个提交就用 --skip。git rebase --abort 会精确回到 rebase 开始之前的位置,已提交的东西一点不丢,但你到目前为止手工解决的冲突会一起消失。
Q. 怎么修?
git rebase --abort —— 执行前先看上面的说明,确认这条命令会丢掉什么。
Q. 这是哪个工具报的?
git。它属于Git,报错原文有 8 个词。
相关报错
CONFLICT (content): Merge conflict in src/app.tsxgitfatal: Unable to create '/repo/.git/index.lock': File exists.gitYou are in 'detached HEAD' state.gitWarning: you are leaving 1 commit behind, not connected to any of your branches:giterror: failed to push some refs to 'https://github.com/user/repo.git'git! [rejected] main -> main (fetch first)git! [rejected] main -> main (non-fast-forward)gitUpdates were rejected because the remote contains work that you do not have locally.git