git - 交互式 rebase 和普通 rebase 有什么区别?

标签 git git-rebase

interactive rebase 有什么不同,比如:

git rebase -i HEAD~3

并且在没有 -i 的情况下 rebase :

git rebase HEAD~3

最佳答案

正如 Thomas Edwards 评论的那样,文档在这里很有帮助。因为是 pro git book (特别是关于 rebasingrewriting history 的部分。

rebase 的核心是检查根提交并逐个应用一系列提交。

当你做一个常规的 rebase 时(git rebase HEAD~3),这会自动发生。

然而,当您进行交互式 rebase 时(git rebase -i HEAD~3),您有机会编辑提交。

这看起来像是修改提交消息、将提交压缩在一起、编辑提交中的更改甚至完全删除提交!

关于git - 交互式 rebase 和普通 rebase 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49626717/

相关文章:

Git 将单个提交从 feature_branch 移​​动到 master

git - 需要 git rebase -Ignore-all-space 来保留我的空间

.bat 脚本中的 git 克隆

git - 是否有任何 git merge-strategies 用于忽略提交或分支 merge 到目标分支的子模块更新?

git - 从 github 中删除子项目提交

macos - git分支切换需要半分钟?

GitLab CI - 尝试使用 docker buildx 为 ARM64 构建

Git 交互式 rebase 没有删除我的其他提交

git - 如何推/pull Git rebase

git - 自 rebase 开始以来中止旧的 git rebase 并丢失提交