[英]How to squash specific commits that have been pushed to remote?
I have made the following commits in my branch and pushed them to remote 我在分支中进行了以下提交,并将其推送到远程
commit 5
commit 4
commit 3
commit 2
commit 1
I now want to squash commits 1, 2 & 3 and remove commits 4 & 5 (dont need the changes anymore) How can i do this? 我现在要压缩提交1、2和3,并删除提交4和5(不再需要更改),我该怎么做?
Once pushed, you cannot easily change the history without affected other users, so it becomes a communication problem. 推送后,您将无法轻松更改历史记录而不影响其他用户,因此这成为通信问题。
One approach would be: 一种方法是:
branch
to the new origin/branch
branch
重新设置为新的origin/branch
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.