2013-10-11 57 views
6

我們正在使用git-flow。我們在幾個不同的功能分支上工作,並不斷收到此錯誤:爲避免意外合併,git流程中止

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: 

一般情況下,恢復到早期版本的開發工作。但是,這是一個痛苦。因此,問題:

如何避免在未來這個消息?

回答

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

+0

我會嘗試下一次出現這種情況。謝謝。 – Sardathrion

1

發生這種情況是因爲您沒有RWT-6閥門本地分支。

你必須創建本地分支

$ 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' 

然後你可以使用命令

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