Skip to content
Latchkey
Git

Clone, auth, merge, and LFS errors in CI - resolved.

Fix Git failures in CI: clone and fetch errors, authentication and credential problems, shallow-clone issues, merge conflicts, and Git LFS failures. Clear, practical fixes.

Clone & fetch

Shallow clones, depth, and submodules.

"Failed to fetch the initial revision"Fix actions/checkout "The process ... git failed ... Failed to fetch the initial revision" in CI - the shallo… "the ref ... does not exist"Fix actions/checkout failing because the requested ref does not exist in CI - a wrong branch/tag/SHA in the `… "clone of ... failed" (submodule)Fix git "fatal: clone of 'URL' into submodule path 'X' failed" in CI - a submodule could not be cloned, usual… "Could not find remote branch ... to clone"Fix the Git "fatal: Remote branch <name> not found in upstream origin" error in CI when a clone or checkout t… "Could not read from remote repository"Fix the Git "fatal: Could not read from remote repository" error in CI, caused by missing access rights, a wr… "Could not resolve host: github.com"Fix the Git "Could not resolve host" error in CI, caused by DNS failures, missing proxy config, or restricted… "destination path already exists"Fix Git "fatal: destination path '...' already exists and is not an empty directory" in CI - a leftover check… "destination path already exists"Fix git "fatal: destination path 'X' already exists and is not an empty directory" in CI - a self-hosted runn… "You are in detached HEAD state"Understand and fix the Git "detached HEAD" state in CI, where the checkout lands on a commit SHA with no bran… "detected dubious ownership"Fix Git "fatal: detected dubious ownership in repository at ..." in CI - the checkout is owned by a different… safe.directory exceptionConfigure Git safe.directory in CI for "fatal: detected dubious ownership in repository" - add the workspace… "object file is empty"Fix Git "error: object file .git/objects/.. is empty" / "loose object is corrupt" in CI - a truncated or corr… "pathspec ... did not match"Fix git "error: pathspec 'X' did not match any file(s) known to git" in CI - the branch, tag, or commit is no… "failed to clone submodule"Fix Git submodule init/update failures in CI - "fatal: clone of ... failed" / "no submodule mapping found" ca… "port 443: Connection timed out"Fix Git "fatal: unable to access ... Failed to connect to github.com port 443" in CI - transient network drop… "fatal: bad object"Fix Git "fatal: bad object <ref>" in CI - referencing a commit/ref that is not present locally, usually becau… "fatal: bad object"Fix git "fatal: bad object <sha>" in CI - git was asked about a commit that is not in the local object store,… "Could not read from remote repository"Fix Git "fatal: Could not read from remote repository" in CI - wrong remote URL, missing access, or an auth/c… "couldn't find remote ref"Fix Git "fatal: couldn't find remote ref" in CI - checking out a branch, tag, or SHA that does not exist on t… "fatal: early EOF"Fix Git "fatal: early EOF" and "fatal: index-pack failed" in CI - the pack transfer ended before all objects… "not a git repository"Fix Git "fatal: not a git repository (or any of the parent directories): .git" in CI - running Git from the w… "pack has bad object"Fix Git "fatal: pack has bad object at offset ..." / "packfile is corrupted" in CI - a damaged packfile in th… "protocol error: bad pack header"Fix Git "fatal: protocol error: bad pack header" in CI - the remote (or a wrapper script) wrote non-Git outpu… "reference is not a tree"Fix Git "fatal: reference is not a tree" in CI - a commit or tag you checkout is missing because a shallow cl… "fatal: reference is not a tree"Fix git "fatal: reference is not a tree: <sha>" in CI - the requested commit is not present locally, usually… "refusing to merge unrelated histories"Fix Git "fatal: refusing to merge unrelated histories" in CI - a pull/merge between two branches with no comm… "repository not found"Fix Git "fatal: repository not found" / "remote: Repository not found" in CI - a wrong URL, a deleted/renamed… "remote end hung up unexpectedly"Fix Git "fatal: the remote end hung up unexpectedly" in CI - the connection dropped mid-transfer on a large c… "filtering not recognized by server"Fix Git partial-clone errors in CI - "fatal: --filter ... filtering not recognized by server" or missing blob… "insufficient permission ... object ... database"Fix git "error: insufficient permission for adding an object to repository database .git/objects" in CI - the… "not a git repository"Fix the Git "fatal: not a git repository (or any of the parent directories): .git" error in CI when a step ru… "reference is not a tree"Fix the Git "fatal: reference is not a tree" error in CI when a checkout or merge needs a commit that a shall… "refspec did not match"Fix Git "fatal: refspec ... does not match any" / no-match fetch refspecs in CI - fetching a PR ref or branch… "refusing to merge unrelated histories"Fix the Git "fatal: refusing to merge unrelated histories" error in CI when a merge or pull joins two branche… "upload-pack: not our ref"Fix git "fatal: remote error: upload-pack: not our ref <sha>" in CI - a fetch asked for a specific commit tha… "upload-pack: not our ref"Fix Git "fatal: remote error: upload-pack: not our ref <sha>" in CI - fetching a specific commit that was for… "Repository not found"Fix the Git "remote: Repository not found" error in CI, caused by a wrong path, a private repo the runner can… "RPC failed; curl 18"Fix Git "RPC failed; curl 18 transfer closed with outstanding read data" / "early EOF" on big clones in CI -… "RPC failed; curl 56 ... HTTP 500"Fix the Git "RPC failed; curl 56" and "HTTP 500" errors when cloning a large repository in CI, caused by conn… "RPC failed; curl 92 HTTP/2"Fix Git "RPC failed; curl 92 HTTP/2 stream was not closed cleanly" / "curl 56 Recv failure" in CI - an HTTP/2… "RPC failed; HTTP 400"Fix Git "RPC failed; HTTP 400 curl 22 The requested URL returned error: 400" on a large push in CI - the requ… "shallow update not allowed"Fix the Git "shallow update not allowed" push error in CI, which happens when you try to push from a shallow… "The remote end hung up unexpectedly"Fix the Git "fatal: The remote end hung up unexpectedly" error in CI, caused by the server closing the connec… "index.lock: File exists"Fix git "fatal: Unable to create '.git/index.lock': File exists" in CI - a stale lock from a killed process,… "Could not find remote branch"Fix git "warning: Could not find remote branch X to clone" / "remote branch X not found in upstream origin" i… "redirecting to https"Fix Git "warning: redirecting to https://.../" in CI - an http:// or trailing-slash-less remote URL the host… "local changes would be overwritten"Fix Git "error: Your local changes to the following files would be overwritten by checkout/merge" in CI - a d… Detached HEAD after checkoutFix a detached HEAD in CI where scripts expect a branch - actions/checkout checks out a commit, not a branch,… fetch-depth 0 for history/tagsFix tools that fail on a shallow clone in CI - git blame, describe, tag lookups, and diffs against a base nee… Shallow clone, no historyFix shallow-clone failures in CI where git log, git describe, or a diff against the base branch breaks becaus… "No url found for submodule path"Fix git "fatal: No url found for submodule path X in .gitmodules" in CI - the working tree has a submodule gi…

Authentication

Tokens, SSH keys, and credentials.

"terminal prompts disabled"Fix git "fatal: could not read Username for 'https://github.com': terminal prompts disabled" in CI - a privat… "git failed with exit code 128"Fix "The process '/usr/bin/git' failed with exit code 128" from actions/checkout in CI - a generic git fatal… "Authentication failed" (token)Fix Git "fatal: Authentication failed for ..." when using a token in CI - an expired/revoked token, a fine-gr… "Authentication failed for https://..."Fix the Git "fatal: Authentication failed" error for HTTPS in CI, caused by an invalid, expired, or insuffici… "could not read Username"Fix Git "fatal: could not read Username for ...: No such device or address" in CI - a credential prompt with… "could not read Username ... No such device"Fix the Git "could not read Username ... No such device or address" error in CI, caused by Git prompting for… "Authentication failed"Fix Git "fatal: Authentication failed for ..." over HTTPS in CI - a missing or invalid token, an expired cred… "could not read Username"Fix Git "fatal: could not read Username for ...: terminal prompts disabled" in CI - no token or credential he… "fatal: not a git repository"Fix git "fatal: not a git repository (or any of the parent directories): .git" in CI - a git command ran in a… "fatal: repository not found"Fix git "fatal: repository not found" in CI - the remote returned 404, usually a private repo the token canno… "The requested URL returned error: 403"Fix git "fatal: unable to access ...: The requested URL returned error: 403" in CI - a later git step lost th… "Permission denied (publickey)"Fix Git SSH "git@github.com: Permission denied (publickey)" in CI for deploy keys - the right private key is… "Host key verification failed"Fix the Git "Host key verification failed" error in CI over SSH, caused by github.com not being present in th… "Host key verification failed"Fix Git "Host key verification failed" in CI - the Git host is not in known_hosts, so SSH aborts before authe… "Password authentication is not supported"Fix the GitHub "Support for password authentication was removed" CI error by switching HTTPS Git from an acco… "Permission denied (publickey)"Fix the Git "git@github.com: Permission denied (publickey)" error in CI, caused by a missing SSH key, an unlo… "Permission denied (publickey)"Fix Git "git@github.com: Permission denied (publickey)" in CI - no SSH key loaded, the key not added to the h… "Invalid username or password"Fix Git "remote: Invalid username or password" over HTTPS in CI - a wrong/empty credential, a password where… "SSL certificate problem"Fix Git "SSL certificate problem: self signed certificate in certificate chain" in CI - a missing CA bundle o… "GITHUB_TOKEN ... Permission ... denied"Fix the GitHub Actions "Permission to org/repo.git denied to github-actions[bot]" push error, caused by the d… "403" - insufficient token scopeFix Git "remote: Permission ... denied" / 403 in CI - a PAT, fine-grained token, or GITHUB_TOKEN that authent… "kex_exchange_identification"Fix Git SSH "kex_exchange_identification: Connection closed by remote host" in CI - the SSH handshake was cut… "Load key: invalid format"Fix Git SSH "Load key ...: invalid format" in CI - a private key stored without a trailing newline, with CRLF… "Too many authentication failures"Fix Git SSH "Received disconnect ... Too many authentication failures" in CI - the agent offers too many keys… "failed to clone ... submodule"Fix Git submodule authentication failures in CI, where the parent repo clones fine but a private submodule ca… "password authentication was removed"Fix GitHub "Support for password authentication was removed. Please use a personal access token instead." in… Private submodule auth in CIFix private submodule authentication in CI - the parent repo checks out but a private submodule fails to fetc… "Permission denied (publickey)"Fix git submodule "git@github.com: Permission denied (publickey)" in CI - a submodule declared with an SSH UR…

LFS & large files

LFS pulls, quotas, and pointers.

LFS pointer instead of fileFix files that are tiny LFS pointer text instead of real content in CI - actions/checkout does not pull LFS o… "LFS: Authentication required"Fix Git LFS "Authentication required" / 401 batch-API failures in CI - the LFS endpoint needs credentials the… "LFS batch request: 403"Fix Git LFS "Error downloading object ... batch request: ... 403" in CI - the LFS endpoint forbade the batch… "should have been pointers"Fix Git LFS "Encountered N file(s) that should have been pointers, but weren't" in CI - files matching .gitat… "lfs filter-process: not found"Fix Git "error: external filter 'git-lfs filter-process' failed" / "git-lfs filter-process: command not found… "git-lfs: command not found"Fix Git LFS "git-lfs: command not found" / "git: 'lfs' is not a git command" in CI - Git LFS is not installed… "lfs is not a git command"Fix the Git LFS "git: lfs is not a git command" / "smudge filter lfs failed" error in CI when the git-lfs bin… "LFS object ... does not exist"Fix the Git LFS "Object does not exist on the server" 404 error in CI, caused by an LFS object that was never… "This repository is over its data quota"Fix the Git LFS "batch response: This repository is over its data quota" 403 error in CI, caused by exceeding… "Smudge error"Fix Git LFS "Error downloading object" / "smudge filter lfs failed" in CI - a transient LFS download failure… "over its data quota"Fix Git LFS "This repository is over its data quota" / "Account responsible for LFS bandwidth should purchase… "over its data quota"Fix Git LFS "batch response: This repository is over its data quota" in CI - the LFS storage/bandwidth budget… "pointer file is invalid"Fix Git LFS "pointer file is invalid" / "wrong number of objects" in CI - a malformed or merge-mangled LFS po… LFS pointers instead of filesFix Git LFS in CI where files contain pointer text instead of real content - LFS was not installed before che… LFS pull timeoutFix Git LFS pull timeouts in CI - a large object download stalls or exceeds the client activity timeout. Rais…
Explore other topics