我遵循描述的工作流程here,因爲我發現許多指向此頁面的引用都是一個很好的工作流程。正如文章中提到的,「功能」分支是由開發人員共享的,但不要去中央存儲庫。如何與多個開發人員共享git功能(或主題)分支
比方說,開發者「A」啓動一個新的功能分支git checkout -b newfeature develop
。現在讓我們說開發者「B」也需要處理這個功能。這是我的問題。
我所做的:
- 開發商「B」,增加了發展商的機器用作遠程
- 開發商「B」運行
git branch remoteA/newfeature
- 開發商「B」工作在這個分支,提交他的工作和將更改推回到remoteA。
第3步現在不工作。我收到一條消息:
remote: error: By default, updating the current branch in a non-bare repository is denied, because it will make the index and work tree inconsistent with what you pushed, and will require 'git reset --hard' to match the work tree to HEAD.
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to 'ignore' or 'warn' in the remote repository to allow pushing into its current branch; however, this is not recommended unless you arranged to update its work tree to match what you pushed in some other way.
remote: error: To squelch this message and still keep the default behaviour, set receive.denyCurrentBranch' configuration variable to 'refuse'.
我已經設置了sharedRepository = true
,但它沒有幫助。
我有2個問題:
- 什麼對開發者之間共享功能分支的正確方法是什麼?
- 如何將開發者B的存儲庫中的更改推回到開發者A的原始版本?
和:我建議對非裸存儲庫之間推動的變化,因爲它只是介紹你不想的問題要:) :) – Tigraine 2011-12-14 12:29:16