2

I am new in git and have problem in merging.
Scenario :

I have a master branch. I create new branch dev from master start commits in dev branch . After two days I create new branch devmerge from dev branch . Now one team was start working on devmerge and one was on dev. Now dev is also some commit history and devmerge is also some commit history but the problem is when I want to merge both devmerge to dev the result missed the some commit history of dev (some dev data is missed) . I don't know what is happening .

1 Answer 1

1

I'd suggest trying it in distinct stages.

Master --------------------- \-----Dev----------------- \-DevMerge---- 

You have the above, perform each merge separately:

git checkout dev git merge devmerge 

Resulting in:

Master -------------------------- \-----Dev------------------m1-- \-DevMerge----/ 

Where m1 is the merge commit.

git checkout master git merge dev 

Resulting in:

Master ----------------------------m2------ \-----Dev------------------m1---/ \-DevMerge----/ 

I'd recommend installing a tool such as gitg depending on the platform you're using, to get a visual representation of the branches.

Sign up to request clarification or add additional context in comments.

1 Comment

hi bcmcfc thanks for quick response but issue is , dev is also has some commit history after devmerge creation. means in both branches developers commits their work now both branches are working branches but now when i merge devmerge into dev some dev files are replaced with devmerge files ,code is overridden although we have changed these files in dev.For explanation I have a file gameconfig.cpp , i changed some lines in dev branch when i merge devmerge into dev this file changes replaced by old devmerge code .

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.