`error: RPC failed; HTTP 400 curl 22` / `send-pack: unexpected disconnect while reading sideband packet` on a large push over HTTPS.
AdvancedTroubleshootingAuthentication and Remote Access
Answer
Likely causes → A very large pack exceeds the HTTP buffer or a proxy or load balancer limit, or the connection drops mid-upload.
Diagnose →
GIT_TRACE_PACKET=1 GIT_CURL_VERBOSE=1 git push 2>&1 | tail -30
git count-objects -vH
Fix → Switch to SSH for the push. Or raise the buffer: git config http.postBuffer 524288000. Push in slices: git push origin <older-sha>:refs/heads/main then the rest. Find and remove accidental big blobs before pushing.
Prevent → Keep large files out of Git (use LFS) and set a repo-size policy.
More on Authentication and Remote Access
`[email protected]: Permission denied (publickey).` followed by `fatal: Could not read from remote repository.`Beginner`remote: Support for password authentication was removed on August 13, 2021.`Beginner`fatal: Authentication failed for 'https://github.com/org/repo.git/'` with a token that worked last month.Beginner`WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!` when connecting to GitHub over SSH.Intermediate`remote: Repository not found.` for a repo you can open in the browser.Beginner`ssh -T [email protected]` says "Hi someone-else!" but you need your work account.Intermediate