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] #8: merge Feature1 branch to Master branch (both commits, diff files) #8

Open dorawyy opened 7 years ago

dorawyy commented 7 years ago

Cloned the repo, work on two branches

Scenario abstraction

Results:

Data could be explored:

git_merge_conflict

Detailed steps

step0: start point of the test case:

(sync the two branches, both local and remote-tracking ones) Preparation done.

The edit is: --> test8-1

screen shot 2017-10-13 at 11 49 40 pm

--> test8-2

screen shot 2017-10-13 at 11 49 44 pm

When the preparation is done, the history is like:

screen shot 2017-10-13 at 11 57 01 pm

Step1: cloned the repo ( already did in testcase #1 )

git clone https://github.com/dorawyy/git-merge-conflicts-test.git git-merge-conflicts-test-1

To make it short, we call them:

Step2: master branch: edited file test8-1, committed

## making sure working on master branch
git branch 
git add test8-1
git commit -m "master: edited the file test8-1"
screen shot 2017-10-14 at 12 01 09 am

The project history in EGit becomes like (master's head moved forward, 1 commit ahead Feature1 branch ):

screen shot 2017-10-14 at 12 02 17 am

Step3: Feature1 branch: edited test8-2 file, add, commit;

# checkout Feature1 branch
git checkout Feature1
git branch
screen shot 2017-10-14 at 12 05 14 am

Step4: checking out master branch, merge Feature1 branch back

screen shot 2017-10-14 at 12 12 40 am
# make sure on master branch
git checkout master
git branch
# merge
git merge Feature1
screen shot 2017-10-14 at 12 13 20 am screen shot 2017-10-14 at 12 14 18 am screen shot 2017-10-14 at 12 14 32 am screen shot 2017-10-14 at 12 19 35 am

As the developer can see, master head moved 1 commit forward, which is a merge commit

Step5: move Feature1 branch forward --> merge

git checkout Feature1
git branch
screen shot 2017-10-14 at 12 22 14 am screen shot 2017-10-14 at 12 22 46 am
# should be in Feature1 branch
git branch
git merge master
screen shot 2017-10-14 at 12 24 45 am

then the history becomes:

screen shot 2017-10-14 at 12 25 52 am

Feature1 head move 1 commit forward, the same as master branch

Step6: push all changes back to remote repo

git checkout master
git branch
git push origin master
screen shot 2017-10-14 at 12 29 02 am

Here is the project log. As the developer can see, the head and origin/master moves forward to the latest commit. however, origin/Feature1 stayed still.

screen shot 2017-10-14 at 12 29 48 am
git checkout Feature1
git branch
git push origin Feature1
screen shot 2017-10-14 at 12 32 16 am

Here is the current history log. Now, everything synced to the latest commit.

screen shot 2017-10-14 at 12 32 54 am

--> master branch

screen shot 2017-10-14 at 12 35 11 am

--> Feature1 branch

screen shot 2017-10-14 at 12 34 38 am

Conclusion: