Gitexit code > 0

fatal: refusing to merge unrelated histories

$fatal: refusing to merge unrelated histories

Analysis

Git refuses to merge two projects that don't share a common ancestor.

Common Triggers

  • Merging two repositories that were started independently.
  • Merging a new local repo into an existing remote repo.

Debug Checks

  • $Check if both branches have completely different commit histories.

Resolution

1
Allow unrelated histories: git merge <branch> --allow-unrelated-histories.