In my local, I made new text file -> git add newfile.txt -> commit -> pull origin master -> ERROR!
"refusing to merge unrelated histories".
What is unrelated histories? , what is related histories?
The “fatal: refusing to merge unrelated histories” Git error occurs when two unrelated projects are merged (i.e., projects that are not aware of each other's existence and have mismatching commit histories). Consider the following two cases that throw this error: You have cloned a project and, somehow, the .
But this doesn't mean that Git cannot perform any merge. In fact, all you need to do to merge unrelated branches is to use the flag --allow-unrelated-histories . This tells Git to combine all the files and commits of both unrelated branches into one branch, as long as there are no file conflicts.
You can use the git reset --merge command. You can also use the git merge --abort command.
Merging is Git's way of putting a forked history back together again. The git merge command lets you take the independent lines of development created by git branch and integrate them into a single branch.
I think you have commit in remote repository and when you pull this error happen.
use this command
git pull origin master --allow-unrelated-histories git merge origin origin/master
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