I'm trying to pull from a remote into a folder in my repo. When using:
git subtree pull --prefix my-local/folder my-remote master
I'm getting the following error:
fatal: refusing to merge unrelated histories
I read in an other post that I can use the option --allow-unrelated-histories
but when I do I get error: unknown option --allow-unrelated-histories
(I put the option last)
I'm using git version 2.10.1 and Windows 10
Any help or ideas on how to move forward with this is greatly appreciated!
Adding a subtree Specify the prefix local directory into which you want to pull the subtree. Specify the remote repository URL [of the subtree being pulled in] Specify the remote branch [of the subtree being pulled in] Specify you want to squash all the remote repository's [the subtree's] logs.
subtree : push: allow specifying a local rev other than HEAD ' git push '(man) lets you specify a mapping between a local thing and a remot ref. So smash those together, and have git subtree push let you specify which local thing to run split on and push the result of that split to the remote ref.
I had this same problem, I got it to work by adding the --squash option. This option merges the subtree changes as a single commit. I am not sure why this works but it obviously solves the history problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With