私がお勧めします:
- 分岐の使用 (この方法では、コミットの順序は重要ではありません。各開発者は、自分のブランチに独自の変更セットを記録します)
- 競合を解決できるメインの「dico」ブランチにブランチを統合します
(Gitは特にこれが得意です)
すぐにテストできます:
C:\test\git>mkdir dico
C:\test\git>cd dico
C:\test\git\dico>git init
Initialized empty Git repository in C:/test/git/dico/.git/
C:\test\git\dico>echo words for B> B.txt
C:\test\git\dico>echo words for K> K.txt
C:\test\git\dico>git add -A & git commit -m "first letters"
[master (root-commit) e91d6fa] first letters
2 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 B.txt
create mode 100644 K.txt
master ブランチに空の dico があります。
DevA が登場:
C:\test\git\dico>git checkout -b devA
Switched to a new branch 'devA'
C:\test\git\dico>echo Kick the Bucket: my def from devA>>B.txt
C:\test\git\dico>type B.txt
words for B
Kick the Bucket: my def from devA
C:\test\git\dico>git add -A & git commit -m "def from devA"
[devA 0f27595] def from devA
1 files changed, 1 insertions(+), 0 deletions(-)
DevB が登場し、devA の作業を取得します。
C:\test\git\dico>git checkout master
Switched to branch 'master'
C:\test\git\dico>type B.txt
words for B
C:\test\git\dico>git checkout -b devB
Switched to a new branch 'devB'
C:\test\git\dico>git merge devA
Updating e91d6fa..0f27595
Fast forward
B.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
C:\test\git\dico>type B.txt
words for B
Kick the Bucket: my def from devA
大野!この定義の場所が間違っています!
C:\test\git\dico>echo words for B>B.txt
C:\test\git\dico>echo Kick the Bucket: my def from devA>>K.txt
C:\test\git\dico>git add -A & git commit -m "move def to K by devB"
[devB 473614d] move def to K by devB
2 files changed, 1 insertions(+), 1 deletions(-)
devB ブランチで修正します。DevB は次のように続けます。
C:\test\git\dico>echo add to def by devB>>K.txt
C:\test\git\dico>git add -A & git commit -m "elaborate def by devB on K"
[devB f9ae17d] elaborate def by devB on K
1 files changed, 1 insertions(+), 0 deletions(-)
つまり、devA ブランチでは、devA もこの定義に取り組んでいます。
C:\test\git\dico>git checkout devA
Switched to branch 'devA'
C:\test\git\dico>type B.txt
words for B
Kick the Bucket: my def from devA
C:\test\git\dico>type K.txt
words for K
C:\test\git\dico>B>>B.txt の devA から elabore def をエコー
C:\test\git\dico>type B.txt
words for B
Kick the Bucket: my def from devA
elabore def from devA in B
C:\test\git\dico>git add -A & git commit -m "devA go on on B.txt"
[devA 1da899a] devA go on on B.txt
1 files changed, 1 insertions(+), 0 deletions(-)
devB が devA の作業をチェックすると、競合が検出され、適切に解決されます。
C:\test\git\dico>git checkout devB
Switched to branch 'devB'
C:\test\git\dico>git merge devA
Auto-merging B.txt
CONFLICT (content): Merge conflict in B.txt
Automatic merge failed; fix conflicts and then commit the result.
C:\test\git\dico>git diff
diff --cc B.txt
index 1cc6ea9,a986721..0000000
--- a/B.txt
+++ b/B.txt
@@@ -1,1 -1,3 +1,6 @@@
words for B
++<<<<<<< HEAD
++=======
+ Kick the Bucket: my def from devA
+ elabore def from devA in B
++>>>>>>> devA
彼は B.txt から余分な定義を削除し、それを K.txt に追加します (そして、devA に行き、停止し、作業をマージし、正しいファイルで続行するように指示します!)