简体   繁体   English

git 压缩提交后将功能分支合并到主分支

[英]git merge feature branch to master branch after squashing commits

I have a feature branch with several commit messages, and the commit messages were squashed into a single commit when merging with the master branch.我有一个带有多个提交消息的功能分支,当与主分支合并时,提交消息被压缩为一个提交。 Now, I have made another change in the feature branch, and when I try to merge with the master branch, due to differences in the history, I can see all the changes and commits that were squashed.现在,我在 feature 分支中做了另一个更改,当我尝试与 master 分支合并时,由于历史记录的差异,我可以看到所有被压扁的更改和提交。

How can I merge the feature branch with the master branch while preserving the squashed commits?如何在保留压缩提交的同时将功能分支与主分支合并?

If I undertand you correctly you can achive what you want using merge with --no-ff key but not --squash This will allow you to have following structure如果我理解正确,你可以使用--no-ff键而不是--squash来实现你想要的这将允许你有以下结构

项目结构

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

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