🌿 Git errors

Git and GitHub errors: rejected pushes, merge conflicts, SSH keys and unrelated histories.

CodeErrorWhat it means
not a git repository fatal: not a git repository (or any of the parent directories): .git You ran a Git command outside a Git working tree.
non-fast-forward Git: ! [rejected] … (fetch first) — error: failed to push some refs The remote branch has commits you don’t have locally, so Git refuses to overwrite them. Pull (merge or rebase…
CONFLICT Git: CONFLICT (content): Merge conflict in file — Automatic merge failed Both branches changed the same lines; Git needs you to choose the final content before completing the merge/r…
unrelated histories Git: fatal: refusing to merge unrelated histories The two branches have no common ancestor — typically a local repo and a remote that were both initialized sep…
publickey Git: Permission denied (publickey). fatal: Could not read from remote repository. SSH authentication to GitHub/GitLab/Bitbucket failed — no key, wrong key, or the key isn’t added to your acco…