简体   繁体   English

我如何压缩git中的前2个提交并自动选择最旧的提交日志

[英]how do i squash top 2 commits in git and automatically pick the oldest commit log

I understand that git rebase -i HEAD~2 would open the commits in an interactive mode. 我知道git rebase -i HEAD〜2会以交互方式打开提交。 I want to skip all those steps and just squash those 2 top commits and pick the commit message from HEAD^. 我想跳过所有这些步骤,而仅压缩这2个顶级提交,并从HEAD ^中选择提交消息。 How can I accomplish that? 我该怎么做? Thanks 谢谢

git reset --soft HEAD ^ && git commit --amend --no-edit

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

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