dorawyy / git-merge-conflicts-test

This repo is for testing of git functionalities / different merging conflict scenarios, and CI tools usage
2 stars 4 forks source link

[testcase notes] #24: Different Merge Strategies Test #62

Open dorawyy opened 6 years ago

dorawyy commented 6 years ago

Sumamry:

Branches used in the series of tests:

Files used in the series of tests:

Preparation

(content of test24-content-conflict)

1

(content of test24-delete-modify-conflict)

2

(content of test24-ms1 and test24-ms2)

3 4 5

references

dorawyy commented 6 years ago

Scenario1:

Scenario prep

git checkout ms1
# edit file test24-content-conflict, line 2
git add test24-content-conflict
git commit -m "ms1: edit file test24-content-conflict, line2"

(ms1 edit file test24-content-conflict, line 2)

screen shot 2017-10-27 at 11 45 35 am

(the project status becomes:)

screen shot 2017-10-27 at 11 47 29 am
git checkout ms2
# edit file test24-content-conflict, line 2
git add test24-content-conflict
git commit -m "ms2: edit file test24-content-conflict, line2"

(ms2 edit file test24-content-conflict, line 2)

screen shot 2017-10-27 at 11 48 31 am

(the project status becomes:)

screen shot 2017-10-27 at 11 48 59 am

1. Using resolve merge strategy

git checkout ms2
git merge ms1 -s resolve
screen shot 2017-10-27 at 11 54 23 am screen shot 2017-10-27 at 11 55 06 am

Then resolve the conflict

screen shot 2017-10-27 at 4 25 31 pm
git add test24-content-conflict
git commit 
# then, auto commit message created for the merge
screen shot 2017-10-27 at 4 26 25 pm screen shot 2017-10-27 at 4 27 45 pm screen shot 2017-10-27 at 4 28 20 pm

After work (reset back to before merging)

git checkout ms2
git reset --hard head~
screen shot 2017-10-27 at 4 29 44 pm

2. Using recursive merge strategy (by default for merging two branches)

3. Using octopus merge strategy

4. Using ours merge strategy

5. Using subtree merge strategy