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操作一次就可以了

相关推荐
Rysxt_25 分钟前
IDEA中Git隐藏更改(Stash)功能详解教程
数据库·git·intellij-idea·stash
Mr-Apple2 小时前
记录一次git commit --amend的误操作
大数据·git·elasticsearch
UVM_ERROR3 小时前
Git仓库损坏(Segmentation fault)修复实战:虚拟机环境下UVM项目救援指南
笔记·git·vscode·github·芯片
j_xxx404_4 小时前
Linux:版本控制器Git(第一章)|历史|理解Git|相关git操作|提交冲突解决
linux·运维·git·ai
牛奔4 小时前
git本地提交后,解决push被拒绝 error: failed to push some refs to
大数据·git·elasticsearch·搜索引擎·全文检索
少年姜太公14 小时前
什么?还不知道git cherry pick?
前端·javascript·git
MatrixOrigin18 小时前
在数据库里玩“平行宇宙”:MatrixOne Data Branch 让数据也拥有Git 的分支/合并/对比/回滚(含跨集群同步)
git·sql·数据分析
VcB之殇18 小时前
git常用操作合集
前端·git
路 西20 小时前
在局域网内共享本地 Git 仓库的方法
git
怣疯knight20 小时前
不小心执行了 git revert,如何恢复到被撤销前的状态
git