0
Lets say I have two branch like this:
o---o---o---o---o master
\
o---o---o feature
If I run the following commands:
$ git checkout master
$ git merge feature
what will happen?
o---o---o---o---o master o---o---o---o---o master
\ / or this \ \
o---o---o---- feature o---o---o-------o feature
but if we create a branch feature2 and commit and push file testfile2 and later try to merge it with master it merges testfile of feature and testfile2 of feature2 same goes in push. May i know the reason or how to avoid it – insoftservice – 2019-03-01T11:13:35.753
@insoftservice Based on my example, all commits will include
testfile
since it was present in the first commit. – Kris Harper – 2019-03-01T14:10:49.503thx for your comments. If u create new branch say feature2 with new file say testfile2 commit it and push in feature2. but when u merge it to master it merges testfile2 and even testfile – insoftservice – 2019-03-01T15:49:05.287
@insoftservice I'm not really sure what you're saying. Are you saying that
master
will have bothtestfile
andtestfile2
? That's the expected behavior, sincetestfile
was part of the first commit. – Kris Harper – 2019-03-01T19:55:35.370yes testfile has to be present in master as it was part of first branch but in my case it shows that it is part of second branch also and if there is third commit with file3 it would show file,file2 and file3 as part of third branch that's my issue. Hope i was able to clarify my problem – insoftservice – 2019-03-02T19:41:26.880
Have created new question for the same If you could please show me my mistake i would really grateful to you .https://superuser.com/questions/1410441/git-merge-to-branch-merges-files-from-previous-merged-branches?noredirect=1#comment2127896_1410441
– insoftservice – 2019-03-02T19:46:24.840