赞
踩
rebase 合并提交
假设提交了 三次
commit -a -m ‘sub1’
commit -a -m ‘sub2’
commit -a -m ‘sub3’
查看提交历史信息:
git log --graph --oneline
开始合并 最近的三次提交
git rebase -i HEAD~3
再vim编辑器里面进入到编辑模式 将 修改为 s 或者 f
s: squash 的简写,和前一个commit 合并
f: fixup 的简写,和前一个commit 合并,但我不要保留该提交的注释信息
p: pick 保留该commit
d: drop 我要丢弃掉该commit
合并commit 也可以使用 git rebase -i startPonit endPoint
加色要合并这几个提交,从a开始合并
2eeb74a: modify c
5d340c4: modify b
e51aaca: modify b
16aee3f: modify b
58c8fed: modify a
则:git rebase -i 58c8fed
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。