Lete me have an example
- Alice creates topic branch A, and works on it
- Bob creates unrelated topic branch B, and works on it
- Alice does git checkout master && git pull. Master is already up to date.
- bob does git checkout master && git pull. Master is already up to date.
- Alice does git merge topic-branch-A
- Bob does git merge topic-branch-B
- Bob does git push origin master before Alice
- Alice does git push origin master, which is rejected because it's not a fast-forward merge.
- Alice looks at origin/master's log, and sees that the commit is unrelated to hers.
- Alice does git pull --rebase origin master
- Alice's merge commit is unwound, Bob's commit is pulled, and Alice's commit is applied after Bob's commit.
- Alice does git push origin master, and everyone is happy they don't have to read a useless merge commit when they look at the logs in the future.
In the above example git pull --rebase works perfectly fine but if point 9 is as below.
- Alice looks at origin/master's log, and sees that the commit is related to hers.
What needs to be done to resolve this as if we proceed with point 10,11 then
- Will Bobs commit gets changed with Alice changes
- Will bobs commit remains and alice changes gets discarded
- will both commits stay together with some information of this
- Will there be any conflict message
What should be the case and how to tackle this?