Podążam za przepływem pracy opisanym jako here, ponieważ znalazłem wiele odniesień wskazujących tę stronę jako dobry przepływ pracy. Jak wspomniano w artykule, gałęzie "funkcji" są współdzielone między programistami, ale nie przechodzą do centralnego repozytorium.Jak udostępnić oddział funkcji git (lub tematu) wielu programistom
Załóżmy, że programista "A" uruchamia nowy oddział funkcji z git checkout -b newfeature develop
. Teraz powiedzmy, że deweloper "B" musi również pracować nad tą funkcją. To jest mój problem.
Co zrobiłem:
- deweloper "B" dodaje maszynę deweloperowi jako zdalnego
- deweloperskim "B" biegnie
git branch remoteA/newfeature
- deweloper "B" działa w tej branży, popełnić swoją pracę i przekazuje zmiany z powrotem do remoteA.
Krok 3 nie działa, właśnie teraz. Dostaję komunikat:
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'.
już ustawiony sharedRepository = true
, ale to nie pomogło.
mam 2 pytania:
- co jest poprawny sposób udostępniania funkcji między gałęzie deweloperów?
- Jak mogę cofnąć zmiany w repozytorium dewelopera B na oryginalną wersję dewelopera A?
I znowu: ja odradzam pchanie zmiany między non-gołymi repozytoriach jak to tylko wprowadza problemu nie ma mieć :) – Tigraine