解决“fast-forward, aborting”问题

1. 现象对某一个远程仓库 git pull 过程中,报错如下:
# zl @ srv123 in ~/git/radxa/kernel [14:09:54]$ git pullremote: Enumerating objects: 5, done.remote: Counting objects: 100% (5/5), done.remote: Total 5 (delta 4), reused 5 (delta 4), pack-reused 0展开对象中: 100% (5/5), 580 字节 | 145.00 KiB/s, 完成.来自 https://github.com/radxa/kernel05483899648a..b902fb9b8f5estable-5.10-rock5-> origin/stable-5.10-rock5 * [新标签]5.10.66-14-rockchip -> 5.10.66-14-rockchipfatal: 无法快进,终止 。2 . 尝试 rebse 失败 zl @ srv123 in ~/git/radxa/kernel [14:18:40] C:128$ git rebase origin/stable-5.10-rock5warning: 跳过了先前已应用的提交 b20c76419838#[...忽略大量输出...]warning: 跳过了先前已应用的提交 c5e33d713633提示:使用 --reapply-cherry-picks 来包括跳过的提交提示:Disable this message with "git config advice.skippedCherryPicks false"自动合并 arch/arm64/boot/dts/rockchip/Makefile冲突(内容):合并冲突于 arch/arm64/boot/dts/rockchip/Makefile自动合并 arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts冲突(添加/添加):合并冲突于 arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dtserror: 不能应用 8d8ce536694e... arm64: dts: rockchip: add ROCK 5B board提示:Resolve all conflicts manually, mark them as resolved with提示:"git add/rm <conflicted_files>", then run "git rebase --continue".提示:You can instead skip this commit: run "git rebase --skip".提示:To abort and get back to the state before "git rebase", run "git rebase --abort".不能应用 8d8ce536694e... arm64: dts: rockchip: add ROCK 5B board# zl @ srv123 in ~/git/radxa/kernel [14:19:00] C:1$ git status交互式变基操作正在进行中;至 b902fb9b8f5e最后一条命令已完成(1 条命令被执行):pick 8d8ce536694e arm64: dts: rockchip: add ROCK 5B board接下来要执行的命令(剩余 9 条命令):pick bc4c96c590e6 arm64: rockchip_linux_defconfig: add general optionspick e712286fbba5 arm64: rockchip_linux_defconfig: enable network modules(使用 "git rebase --edit-todo" 来查看和编辑)您在执行将分支 'stable-5.10-rock5' 变基到 'b902fb9b8f5e' 的操作 。(解决冲突,然后运行 "git rebase --continue")(使用 "git rebase --skip" 跳过此补?。?(使用 "git rebase --abort" 以检出原有分支)未合并的路径:(使用 "git restore --staged <文件>..." 以取消暂存)(使用 "git add <文件>..." 标记解决方案)双方修改:arch/arm64/boot/dts/rockchip/Makefile双方添加:arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts修改尚未加入提交(使用 "git add" 和/或 "git commit -a")# zl @ srv123 in ~/git/radxa/kernel [14:21:24]$ git rebase --abort3. 切换到其他分支 , 然后删除本分支# zl @ srv123 in ~/git/radxa/kernel [14:21:40]$ git checkout release-4.4-rockpi4正在更新文件: 100% (94089/94089), 完成.切换到分支 'release-4.4-rockpi4'您的分支与上游分支 'origin/release-4.4-rockpi4' 一致 。# zl @ srv123 in ~/git/radxa/kernel [14:22:01]$ git branch -D stable-5.10-rock5已删除分支 stable-5.10-rock5(曾为 c5e33d713633)4. 然后重新 checkout (本地分支 track 远程分支)【解决“fast-forward, aborting”问题】# zl @ srv123 in ~/git/radxa/kernel [14:22:09]$ git checkout --track origin/stable-5.10-rock5正在更新文件: 100% (94123/94123), 完成.分支 'stable-5.10-rock5' 设置为跟踪来自 'origin' 的远程分支 'stable-5.10-rock5' 。切换到一个新分支 'stable-5.10-rock5'

    推荐阅读