Git Release with a Master Reverted Commit

时间:2016-10-27 12:54:45

标签: git github merge release revert

我只是按照标准dev / master development model进行git非常令人惊讶的行为。

在过去,我偶然将PR A从贡献者合并到master并在线使用GitHub"还原"添加revert-commit R以修复错误放置的提交的功能。然后,我将A合并到dev

  • master:...- 1-2-3-A-R
  • dev:...- 1-2-3-4-5-6-A -...

几个月后,我发布了一个新版本的软件,并通过一个简单的合并(GitHub上的在线公关)从dev合并到master

  • dev:...- 1-2-3-4-5-6-A-7-8-9作为PR master

合并现在意识到了,嘿,我已经提交了A"并应用所有其他提交。但是现在,A的更改不在主人的头上,因为它还被R还原,然后再次使用{{1}的合并重播} dev应该最终添加master

代码看起来像这样,而A是应用于主分支的合并提交的实际增量:

  • [7-8-9]:... - 1-2-3-A-R- [7-8-9]

以下是GitHub网络可视化的实际git历史记录,简化为: GitHub network graph of git commits

或作为文本图表(将完整的功能分支集)

master

因此,将* b8f9e33 (HEAD, tag: v1.5.0, mainline/master) Merge pull request #253 from dev |\ | * 563da86 Merge pull request #252 | |\ | | * 562f9b4 ChangeLog for Release 1.5.0 | |/ | * b780652 Merge pull request #251 | |\ | | * 2275d92 Werror: On Travis Only | * | 3e02c75 Merge pull request #250 | |\ \ | | |/ | |/| | | * 1674897 update documentation | | * d31a7f1 Attribute Writing: Create Group if Missing | | * a047ab5 extent attribute tests (parallel/serial) | |/ | * f9ebe2e Fixed indentations | * 2b2c146 README: Minor Fix line break | * 9254272 Merge pull request #247 | |\ | | * 2bb3e90 Throw exception on invalid calls | * | c55e4e7 Merge pull request #246 | |\ \ | | |/ | |/| | | * 419cd57 Implement generateCollectionType in cpp | |/ | * 7053e39 Merge pull request #242 | |\ | * \ 32dab56 Merge pull request #243 | |\ \ | | * | 894e31a Compare agains NULL | | * | 0cc4cca Compile in debug mode so runtime tests can trigger assertions | | * | b9e3b14 Move typeid check into assertion | | * | 47a810a Fix memory leak in generateCollectionType * | | | e3f2a88 Merge pull request #241 from revert-234-master |\ \ \ \ | * | | | fb8800e Revert "Make filename creation consistent" |/ / / / * | | | 0b6cb96 Merge pull request #234 |\ \ \ \ | |_|/ / |/| | / | | |/ | |/| | * | 4f6e7e6 Fix close/finalize order | * | f36f925 Disallow using Fullname ... | * | 6f1c0cd Close files on dtor | * | 936c002 Don't delete test h5-files and honor line length | * | e43906a Fix tests | * | a68c7cf Address PR comments | * | 380e5de Consistent use of fileNameScheme instead of singleFile | * | c6033bc Make filename creation consistent |/ / * | 467c85e (tag: v1.4.0) Merge pull request #230 from dev 合并到dev现在会导致"已经是最新的"并将master合并到master建议删除dev。但是......我想要A

你知道吗

  • 优雅地还原此类合并并在以后再次应用它的正确工作流程是什么?
  • 如何从这种情况中恢复?

我的想法是避免重复,因为我所说的存储库是一个主线回购,人们从这里开始开发新功能。我现在唯一的想法就是在命令行执行此类恢复之后将{-1}发布合并到

A

0 个答案:

没有答案