git rebase --onto <base> <from> <to> 命令详解

把一段提交搬到新的基点上

命令语法

git rebase --onto <base> <from> <to>注意

把一段提交搬到新的基点上

示例

$ git rebase --onto main feature old

git rebase --onto <base> <from> <to> 用法说明

git rebase --onto <base> <from> <to> 是「合并与变基」分类下的常用命令,作用是:把一段提交搬到新的基点上。

典型用法如下:git rebase --onto main feature old。你可以复制到终端直接运行,或查看下方同组的相关命令。

常见问题解答

git rebase --onto <base> <from> <to> 是什么?
git rebase --onto <base> <from> <to> 用于把一段提交搬到新的基点上,属于「合并与变基」相关命令。
git rebase --onto <base> <from> <to> 怎么用?
在终端执行 git rebase --onto main feature old 即可,具体参数请按实际环境调整。
还有哪些相关命令?
「合并与变基」分类下还有 11 条相关命令,见下方「相关命令」。