When two separate projects are merged, you may face
fatal: refusing to merge unrelated histories. This occurs when projects are not aware of each other’s presence and have mismatching commit records.
fatal: refusing to merge unrelated histories
This issue has one answer that you can reuse whenever you face the problem.There might sometimes be a good reason not to do the allow.
Why Error Occurs ??
- You may have cloned a project for which the .git directory is erased or damaged.
- In this state, Git is unaware of your local history and will throw this error.
- It's because the two branches have no relationship.
- You may have created a new repository and added commits to it.
- Now you are trying to pull from a remote repository that already exists and already has commits.
- Git will throw the error because it does not know how the two projects are related.
refusing to merge unrelated histories
How to Solve ??
- You can add
- Managed by avoiding creating the repository with a
- Creating without
- Some command already have a ‘Readme. md’ file. Modify the
readme. mdlater on
git pull origin master --allow-unrelated-histories
git pull https://github.com/codejagd/Kit.git --allow-unrelated-histories
For Your Reference Documentation