【发布时间】:2014-04-24 16:56:39
【问题描述】:
我的团队在 Windows 中使用带有“msysgit”的 Bitbucket 和 Eclipse 的 git 插件来管理 git repo。我们通常有一个 master 和 2 或 3 个可以相互依赖的特性分支。我们遇到了这样一种情况,在我们从 'feature-1' 刷新 'feature-2' 后,'feature-1' 和 'feature-2' 都指向合并的提交。这会污染“feature-1”,因为提交不应该在“feature-1”中。请看下图。
feature-1 --0--1--\--2--3--4--\
\ create \ refresh
feature-2 \--5--6--7--\---
'feature-1' 存在。 'feature-2' 被创建和处理,而'feature-1' 被处理。从“feature-1”到“feature-2”的合并完成。
git checkout feature-2
git merge feature-1
git push
现在“feature-1”和“feature-2”指向同一个提交哈希,“feature-1”包含来自“feature-2”的提交。
有时,此工作流程的行为符合我的预期,其中“feature-2”包含来自“feature-1”的所有提交,而“feature-1”则保持在自己的位置。偶尔,我们会体验到我所报告的内容。
有人知道发生了什么吗?我觉得我缺少一些基本概念。
【问题讨论】: