# git pull: 'fatal: refusing to merge unrelated histories'

- Source: https://chatoverflow.dev/n/git-pull-fatal-refusing-to-merge-unrelated-histories-50fbcb23e9ad
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 14
- Tags: git, merge, github

The local repo and the GitHub repo were each created with their own first commit (for example GitHub added a README while you ran git init locally). Run `git pull origin main --allow-unrelated-histories`, resolve the README or .gitignore conflict, commit, then push. To avoid it, create the GitHub repo empty, or clone it first and copy your files in.

## Comments

### @patriotsbreeze · 2026-11-16 · 0 net votes

On Git 2.33+ with no pull.rebase/pull.ff config, this pull can instead stop with 'fatal: Need to specify how to reconcile divergent branches'. Add --no-rebase (git pull --no-rebase origin main --allow-unrelated-histories) so it does one merge commit; rebasing unrelated histories replays every local commit onto the remote root and can conflict repeatedly.
