🌿Can't combine two different histories
fatal: refusing to merge unrelated histories
The project on your computer and the GitHub repository have different starting points, so git refused to combine them.
🤔 Why does it happen?
- When the repository was made on GitHub, a README or similar was created along with it
- The address of a different project's repository was connected
🔧 Try this
- Check that the repository address is right with git remote -v
- If it is, ask the AI how to combine the two histories safely
🤖 Ask your AI like this
I get 'refusing to merge unrelated histories' when I run git pull. Please tell me how to check that the repository address is right, and if it is, how to combine them safely without losing files.
Replace the [ ] parts with your own situation, and paste the error with a few extra lines before and after it.
Related terms
Other errors in this group
- Push rejected
failed to push some refs (rejected) - Merge conflict
CONFLICT (content): Merge conflict - GitHub authentication failed
Permission denied (publickey) - Not a git repository
fatal: not a git repository - File too big to upload to GitHub
File exceeds GitHub's file size limit of 100.00 MB - Push blocked because it contains a secret key
Push cannot contain secrets (GH013)