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 条相关命令,见本页上方「相关命令」。

同类工具