Git Learning — 2

Rose Chang Dycd
Feb 14, 2023

Newbie Git Notes

About Conflict

1. A conflict happens usually is when A branch is going to merge with B branch, and a “CONFLICT” message shown. For instance, the conflicting reason is due to both code files being modified at the same line. (通常是A分支 merge B分支時,顯示 CONFLICT)

2. Open both code files and the two engineers shall discuss first to merge which line or leave both. (把兩個code檔開啟,場外自行協調)

3. Adjust the code file at the HEAD branch. (調整檔案)

4. command: git add <(modified)filename.ext>
(git add 調整後的檔案)
5. command: git commit -m “merge”
(再下 commit 進行 merge 即可:git commit -m “merge”)

6. Then the conflict is resolved and the branches merging is completed.
(即解決衝突並完成分支合併)

--

--