I am dealing with unrelated histories and I know I can force git to merge them by using --allow-unrelated-histories
. However, this option is disabled by default. It must be for a reason, and I am having a hard time finding any documentation about what happens when you use that option and why it is disabled by default.
What does this option do exactly and why would I not want to use it?
For example, say I create a new project and the following happens:
I generate two commits and push them to the remote
master : a -> b
origin/master : a -> b
Then, while I work on more commits, the commits on the remote are modified or replaced (I know this sounds horrible, but it is a very valid workflow when using Gerrit and applying changes to patchsets)
master : a -> b -> c -> d -> e
origin/master : a'-> b'
What happens if I do git pull --allow-unrelated-histories
? What does the tree look like? Does my local branch stack the commits or is there conflict resolution or something else?