美文网首页
Git命令rebase

Git命令rebase

作者: RoyChina | 来源:发表于2019-07-10 22:21 被阅读0次

用法1:

// 现有分支

          A---B---C topic
         /
    D---E---F---G master

// 使用rebase

git rebase master
git rebase master topic

// 得到

                  A'--B'--C' topic
                 /
    D---E---F---G master

用法2:--onto 针对两个分支间的修改切片

// 现有分支

                            H---I---J topicB
                           /
                  E---F---G  topicA
                 /
    A---B---C---D  master

// 使用 --onto 将 topicA ~ topicB 的切片 rebase 到 master

git rebase --onto master topicA topicB

// 得到

                 H'--I'--J'  topicB
                /
                | E---F---G  topicA
                |/
    A---B---C---D  master

用法3:--onto 针对特定 commit 切片

// 现有分支

    E---F---G---H---I---J  topicA

// 使用 --onto 将 topicA~3 ~ topicA 的切片 rebase 到 topicA~5 

git rebase --onto topicA~5 topicA~3 topicA

// 得到

    E---H'---I'---J'  topicA

相关文章

  • git常用命令

    git常用命令 git rebase 合并提交

  • git rebase 命令

    git rebase 命令git rebase是一个非常有用的命令,但可能熟悉它的人比较少。下面介绍一下git r...

  • Git从入门到使用

    对于git命令全了解 Git常用命令简介 git rebase 命令和merge命令作用相似。如果你想要一个干净的...

  • Git ~和^的区别

    在使用git rebase命令时,我们常常想要rebase到HEAD的前n个commit,通常我们使用如下命令: ...

  • git rebase 命令

    介绍 git rebase命令有什么用?rebase中文翻译为"变基"。意思是改变目标基础点。下面我们通过演示一个...

  • Git命令rebase

    用法1: 用法2:--onto 针对两个分支间的修改切片 用法3:--onto 针对特定 commit 切片

  • git rebase 命令

    前言 来啦老铁! 时间过得真快啊,2个多礼拜的时间又过去了,又到了不见不散的学习时间~技术来源于工作(总感觉有点怪...

  • 0 ---

    .git目录文件夹结构git log命令 本地修改、add、commit、push后撤销git rebase -i...

  • git8~rebase

    2019.06.25 git rebase git stash git pull --rebase git sta...

  • GIT常用命令备忘

    Git配置 Git常用命令 查看文件diff 查看提交记录 Git 本地分支管理 分支合并和rebase Git补...

网友评论

      本文标题:Git命令rebase

      本文链接:https://www.haomeiwen.com/subject/naakkctx.html