简体   繁体   English

git rebase第二次和第三次提交

[英]git rebase the 2nd and 3rd commit

假设我的最高和最新提交是A,接下来是B,接下来就是C.如果我想要提交B和C,我怎么能做git rebase?

The easiest is with an interactive rebase 最简单的是使用交互式rebase

git rebase -i HEAD~3

This will bring up your last three commits with pick in front of each. 这将提出你的最后三个提交,每个提交前面的pick If you change the second instance of pick to squash and then save the file and exit, this will squash the two commits together. 如果您将第二个pick实例更改为squash然后保存文件并退出,则会将两个提交压缩在一起。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM