我有一個文件,其中只有一行。 我創建了一個分支並將第二行添加到同一個文件中。保存並提交到分支。 我切換回主人。並在文件中添加不同的第二行。保存並提交給主。 所以總共有3條獨特的線條。爲什麼Git不能將文件更改與修改的父級/主級合併?
如果我現在嘗試並將分支合併回主,它遭受合併衝突。
爲什麼不能Git簡單合併每一行,一個接一個?
我在合併企圖的行爲是這樣的:
PS D:\dev\testing\test1> git merge newbranch
Auto-merging hello.txt
CONFLICT (content): Merge conflict in hello.txt
Automatic merge failed; fix conflicts and then commit the result.
PS D:\dev\testing\test1> git diff
diff --cc hello.txt
index 726eeaf,e48d31a..0000000
--- a/hello.txt
+++ b/hello.txt
@@@ -1,2 -1,2 +1,6 @@@
This is the first line.
- New line added by master.
-Added a line in newbranch.
++<<<<<<< HEAD
++New line added by master.
++=======
++Added a line in newbranch.
++>>>>>>> newbranch
有沒有一種方法,使在自動槽線,一個接一個?
似乎沒有一種簡單的方法來確定它們應該被分割的順序 - 畢竟,當涉及到可執行代碼時,順序肯定會很重要。 – Amber 2010-04-06 22:39:28