有没有办法以非交互方式挤压一些提交? [英] Is there a way to squash a number of commits non-interactively?

查看:72
本文介绍了有没有办法以非交互方式挤压一些提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图压扁一系列的提交 - HEAD到HEAD〜3。有没有一个快速的方法来做到这一点,或者我需要使用rebase --interactive?

I'm trying to squash a range of commits - HEAD to HEAD~3. Is there a quick way to do this, or do I need to use rebase --interactive?

推荐答案

确保您的工作树是干净的,然后

Make sure your working tree is clean, then

git reset --soft HEAD~3
git commit -m'new commit message'

这篇关于有没有办法以非交互方式挤压一些提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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