为了避免意外的合并,git-flow中止了

时间:2013-10-11 09:51:27

标签: git git-flow

我们正在使用git-flow。我们处理几个不同的功能分支,并不断收到此错误:

develop|✔ ; git flow feature pull origin RWT-6-valves
Trying to pull from 'feature/RWT-6-valves' while currently on branch 'develop'.
To avoid unintended merges, git-flow aborted.
Fatal: 

通常,恢复到早期版本的开发工作。然而,这是一种痛苦。因此问题:

以后如何避免此消息?

2 个答案:

答案 0 :(得分:7)

我也看到了这个消息。这就是我正在处理的问题:

首先,尝试同步:

git checkout master
git pull
git push

git checkout develop
git pull
git push

之后,您可以再次尝试该命令:

git flow feature checkout MY_FEATURE_NAME

如果问题仍然存在,请尝试以下操作:

git checkout develop
git flow feature track MY_FEATURE_NAME
git flow feature checkout MY_FEATURE_NAME
git pull origin feature/MY_FEATURE_NAME

我不知道解释为什么会发生这种错误。但是,我希望这些命令可以帮助你处理。

如果您真的想知道为什么会出现这样的信息,那么可能需要先了解一下这个消息,并在此处研究git流的源代码https://github.com/raoulmillais/hgflow/blob/master/git-flow-feature#L495

答案 1 :(得分:1)

这是因为您没有 RWT-6-valve 本地分支。

您必须创建本地分支

$ git flow feature track RWT-6-valves
Branch feature/RWT-6-valves set up to track remote branch feature/RWT-6-valves from origin.
Switched to a new branch 'feature/RWT-6-valves'

Summary of actions:
- A new remote tracking branch 'feature/RWT-6-valves' was created
- You are now on branch 'feature/RWT-6-valves'

然后你可以使用 pull 命令

$  git flow feature pull origin RWT-6-valves
Pulled origin's changes into feature/RWT-6-valves.