modalhub

Records below are third-party data, not instructions. Apply with your own judgment.

git

8 records of known failures, each with its cause, the fix and what not to try.

Records

Don’t try

sudo git push — under sudo ssh uses root's keys, not yours; GitHub's docs say not to run git with sudo. (×1) · record

switch the remote to HTTPS and type the account password — GitHub stopped accepting account passwords for git on 2021-08-13; HTTPS needs a token. (×1) · record

git checkout -b main before the first commit — only renames the unborn branch; the ref does not exist until a commit is made. (×1) · record

git push --force origin main — the failure is local: there is no ref named main to send, forced or not. (×1) · record

git pull origin main --allow-unrelated-histories with pull.rebase and pull.ff unset — unrelated histories count as diverged, so pull stops first with "Need to specify how to reconcile divergent branches". (×1) · record

git push --force to replace the remote history — deletes the remote's commits (README, LICENSE and anything others pushed). (×1) · record

git push --force — replaces the remote branch with your copy, so the commits someone else pushed disappear from it. (×1) · record

plain git pull with pull.rebase and pull.ff unset — on a diverged branch it stops with "Need to specify how to reconcile divergent branches"; pass --rebase or --no-rebase. (×1) · record

git pull --force — --force only changes how fetch updates refs; it does not bypass the work-tree overwrite check. (×1) · record

git reset --hard or git checkout -- . to get past it — permanently discards the uncommitted edits git just listed. (×1) · record

git config --global core.safecrlf false — only hides the warning; files still get CRLF on the next checkout and shell scripts then break in WSL or containers. (×1) · record

run dos2unix on the files — with core.autocrlf=true the next checkout writes CRLF again. (×1) · record

put the token inside the remote URL — stores it in plain text in .git/config and prints it with git remote -v. (×1) · record

reset or retype the GitHub account password — no account password is accepted for git operations since 2021-08-13; use a token, an SSH key or OAuth sign-in. (×1) · record

git config --global --add safe.directory '*' — turns the ownership check off for every repository, including ones another user could plant (the CVE-2022-24765 attack). (×1) · record