简体   繁体   English

Git:insert提交保留无ff历史

[英]Git: insert commits preserving no-ff history

I have git history like this. 我有这样的git历史。

在此处输入图片说明

Then I want to insert 2 commits after commit A (which are ingored at commit B). 然后,我想在提交A之后插入2个提交(这些都归于提交B)。 Like this. 像这样。

在此处输入图片说明

I tried rebase but it swallows no-fast-forward branch. 我尝试重新设置基准,但是它吞没了不快进的分支。 How can I achieve this? 我该如何实现?

A git rebase should work, but you might need to add the --preserve-merges option: git rebase应该可以,但是您可能需要添加--preserve-merges选项:

-p
--preserve-merges

Recreate merge commits instead of flattening the history by replaying commits a merge commit introduces. 重新创建合并提交,而不是通过重播合并提交引入的提交来变平历史记录。 Merge conflict resolutions or manual amendments to merge commits are not preserved. 合并冲突解决方案或手动修订以合并提交不会保留。

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

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