git rebase回退到根

项目初始有2个commit,git rebase -i 合并提交记录只能看到一个最新的,

需要git rebase -i --root才能看到第一个提交

git rebase -i -root以后,编辑提交信息,然后就可以了。

之前本地调试的时候经过多次实验性操作,导致git rebase -i -root以后,

查看git stash 是 Not currently on any branch

*(no branch)

master

这样,解决方法是

git branch temp 新建个分支

git checkout master

git branch -D temp 强制删除了temp分支,

然后再git rebase -i -root操作一次就可以了

相关推荐
studytosky17 分钟前
Linux 基础开发工具(3):Git 控制与 GDB 调试实用指南
linux·运维·服务器·网络·数据库·git
云闲不收2 小时前
AI编程系列——git-worktree并行开发
git·ai编程
秦时明月天明2 小时前
GitLab SSH Key 过期:git pull failed : remote your ssh key has expired
git·ssh·gitlab
桃花岛主703 小时前
命令提交git到github上的步骤
git·github
AI逐月3 小时前
Git 停止追踪已提交文件问题
大数据·git·elasticsearch
是毛毛吧3 小时前
开发环境配置指南:解决 GitHub 连接超时与依赖下载失败的问题
网络·git·网络安全·docker·信息与通信
bj_zhb4 小时前
git stash 用法
git
rockmelodies4 小时前
本地 PyCharm 生成的 Git 仓库与 GitHub 远程仓库关联起来
git·pycharm·github
阿萨德528号4 小时前
Git 与 SVN 对比详解
git·svn
郑州光合科技余经理4 小时前
定制开发实战:海外版外卖系统PHP全栈解决方案
java·服务器·开发语言·javascript·git·uni-app·php