I have a master repository with different subfolders. Each subfolder is brought into the repository as a "subtree" and exists as separate Git repository.
For example:
projectroot/my-subtree (https://repo.com/my-subtree.git)
projectroot/my-subtree1 (https://repo.com/my-subtree1.git)
projectroot/my-subtree2 (https://repo.com/my-subtree2.git)
At this stage, what I have done for each of the subtreees is the following:
md my-subtree
git remote add -f my-subtree https://repo.com/my-subtree.git
git read-tree --prefix my-subtree -u my-subtree/master
Now, I would like to merge the local subtree with the updated code from the remote repository. When I try to do this using the following command, I get an error:
C:\project>git subtree pull --prefix=my-subtree my-subtree master
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
I've tried using the --allow-unrelated-histories
parameter, but it is not recognized my my version of git (2.14.3.windows.1).
I run the command like this:
C:\projects\>git subtree pull --prefix=my-subtree my-subtree master --allow-unrelated-histories
And get back this:error: unknown option
allow-unrelated-histories`
Can I solve the unrelated merge histories issue? Should I be doing something differently? Ideally I would like to be able to commit to projectroot as a normal Git project and push and pull changes from the (3) additional repositories as needed.