An error of Git
Sometimes there are some problems in the process of using Git, so when you solve each problem, you need to summarize and record it, so that you won’t do it again.
A, fatal: refusing to merge unrelated nothing code>
Today, while creating a project with Git, the following error occurred when two branches were merged.
~/SpringSpace/newframe on master ⌚ 11:35:56
$ git merge origin/druid
fatal: refusing to merge unrelated histories
The key to the problem here is: fatal: refusing to merge unrelated nothing code>
you might be in the git pull code> or git push code> are likely to encounter, this is because the two branches without relationship. So what's the solution?
Second, solutions
Behind the commands you add - allow - unrelated - nothing code>
for example:
git merge master - allow - unrelated - nothing code>
~/SpringSpace/newframe on druid ⌚ 11:36:49
$ git merge master --allow-unrelated-histories
Auto-merging .gitignore
CONFLICT (add/add): Merge conflict in .gitignore
Automatic merge failed; fix conflicts and then commit the result.
If you are a git pull code> or git push code> to fatal: refusing to merge unrelated nothing code>
in the same way:
git pull origin master - allow - unrelated - nothing code>
and so on, this is the perfect solution to cough up!