Git errors
- CONFLICT (content): Merge conflict inBoth branches changed the same lines. Edit the file to choose the right content, remove the conflict markers, then git add and commit.
- error: cannot lock refGit couldn't update a branch or remote-tracking ref. Typically stale remote-tracking branches conflict with new names (feature vs feature/login), a leftover .lock file exists, or the ref changed underneath (another git process, case-insensitive filesystem).
- error: cannot pull with rebase: You have unstaged changes.`git pull` is configured to rebase, and rebase refuses to start while the working tree has uncommitted changes. Stash or commit them first, or let Git do it with `--autostash`.
- error: failed to push some refs toThe remote branch has commits you don't have. Pull (or rebase) first, then push again. Don't force-push unless you mean to overwrite others' work.
- error: pathspec 'x' did not match any file(s) known to gitGit can't find the branch or file you named. Fetch remote branches first, check spelling and case, or check the path is tracked.
- error: remote origin already exists.A remote named origin is already configured. Change its URL with git remote set-url, or remove it first.
- error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanlyThe HTTPS connection to the Git server dropped in the middle of a clone, fetch or push — usually a large repo over a flaky network, an HTTP/2 issue, or a proxy/timeout cutting the transfer.
- error: src refspec main does not match anyGit can't find a local branch called main. Either you have no commits yet or your branch is named master.
- error: Your local changes to the following files would be overwritten by mergeYou have uncommitted edits to files the pull/merge would change. Commit them, stash them, or discard them, then pull again.
- fatal: Could not read from remote repository.Git couldn't reach or authenticate to the remote. Usually a wrong remote URL, a missing SSH key, or no access to the repository.
- fatal: detected dubious ownership in repositoryGit refuses to work in a repository owned by another user. Mark it as safe or fix the folder's ownership.
- fatal: not a git repository (or any of the parent directories): .gitYou ran a git command outside a repository. cd into the project folder, or run git init / git clone first.
- fatal: Not possible to fast-forward, aborting.Your local branch and the remote branch both have commits the other doesn't, and Git is configured to only allow fast-forward pulls (pull.ff=only or --ff-only), so it refuses to merge or rebase automatically.
- fatal: refusing to merge unrelated historiesGit won't merge two branches that share no common commit. Fix it with --allow-unrelated-histories, or rebase your work onto the remote.
- fatal: The current branch has no upstream branch.Your new local branch isn't linked to a remote branch yet. Push it once with -u, or tell Git to do this automatically.
- fatal: the remote end hung up unexpectedlyThe connection to the Git server closed in the middle of a push, pull or clone. Usually the push is too large for the HTTP buffer or the host's size limit, the network is unstable, or the server rejected the request.
- fatal: Unable to create '.git/index.lock': File exists.Git found a leftover lock file from another (or crashed) git process. Make sure no git process is running, then delete .git/index.lock.
- git@github.com: Permission denied (publickey).GitHub rejected your SSH key. Check that you have a key, that ssh-agent has it loaded, and that the public key is added to your GitHub account.
- remote: error: GH001: Large files detected. You may want to try Git Large File StorageGitHub rejects pushes containing any file over 100 MB, in any commit being pushed. Deleting the file in a new commit is not enough; it has to be removed from history (or moved to Git LFS).
- remote: Repository not found. fatal: repository not foundThe URL is wrong, or the repository is private and the credentials Git used don't have access. GitHub deliberately reports "not found" instead of "forbidden" for private repos.
- remote: Support for password authentication was removedGitHub no longer accepts your account password for Git over HTTPS. Use a personal access token, the GitHub CLI, or SSH.
- Updates were rejected because the tag already exists in the remoteYou pushed a tag whose name already exists on the remote but points to a different commit. Git refuses to move tags on push unless forced, because others may already have fetched the old tag.
- warning: adding embedded git repositoryA folder you staged contains its own .git directory, so Git records it as a pointer to a commit (a "gitlink") instead of its files. Others who clone get an empty folder.
- warning: LF will be replaced by CRLF the next time Git touches itA harmless line-ending notice on Windows. Git converts line endings because core.autocrlf is on. Use .gitattributes to control it per project.
- You are in 'detached HEAD' state.HEAD points to a commit, not a branch. Switch back to a branch, or create one here to keep any commits you made.