当前位置:   article > 正文

git合并多个提交的方法

git合并多个提交

git合并多个提交的逻辑: 把当前提交合并到前一次提交

2种合并的方式

指定合并提交的个数: git rebase -i HEAD~3

指定合并到哪个提交: git rebase -i 3a4226b, 注意: 3a4226b并不参与合并, 实际合并到3a4226b后一次提交

指令解释(交互编辑时使用):

  • p, pick = use commit
  • r, reword = use commit, but edit the commit message
  • e, edit = use commit, but stop for amending
  • s, squash = use commit, but meld into previous commit
  • f, fixup = like "squash", but discard this commit's log message
  • x, exec = run command (the rest of the line) using shell
  • d, drop = remove commit

参考资料

Git 合并多个 commit - 我的分享 - SegmentFault 思否

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号