在不同的分支上重放最后的N个git提交 [英] Replay the last N git commits on a different branch

查看:154
本文介绍了在不同的分支上重放最后的N个git提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打算在分支主上提交时,我意外地在分支测试上做了10次提交。 测试分支上的其他提交是垃圾,所以我不想将它与主合并。相反,我只想重播master上的最后10次提交。 git checkout master / li>
  • git whatchanged testing

  • git cherry-pick _________


  • I accidentally made 10 commits on branch "testing" when I intended to commit them on branch "master". The other commits on the "testing" branch are garbage, so I don't want to merge it with "master". Instead, I just want to replay the last 10 commits on master.

    解决方案

    1. git checkout master
    2. git whatchanged testing
    3. git cherry-pick _________

    ?

    这篇关于在不同的分支上重放最后的N个git提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆