gh auth login — full setup in Connect to GitHub.The symptom
You typed git push (or clicked Sync in VS Code), entered your GitHub password
when asked, and got this wall of red:
The exact error
$ remote: Support for password authentication was removed on August 13, 2021.
$ remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories for information on currently recommended modes of authentication.
$ fatal: Authentication failed for 'https://github.com/you/project.git/' - The same text appears in an error toast (bottom-right) when a push or Sync Changes fails
- Click Open Git Log in the toast to read the full message in the Output panel
This is Git's message, not commands to run.
What it means
Your GitHub account password — the one you type on the website — no longer
works for Git over HTTPS. GitHub switched that off in 2021. Nothing is broken on your machine;
Git just needs a different kind of key: a personal access token (a long
generated password made only for Git), an SSH key, or a browser sign-in via
the gh command-line tool. The full setup of all three lives in
Connect to GitHub — this page is the fast repair.
Tip: a token is a password — just one made for Git. Paste it wherever Git asks for a "password", never commit it to a repo, and if it ever leaks, delete it on GitHub and make a new one.
The quick fix
The fastest cure is GitHub's own command-line tool, gh. One command opens your
browser, you click Authorize, and it wires up Git for you — no token to copy, nothing
to memorise.
Sign in properly, once
$ gh auth login # browser sign-in wires everything up - Click the Accounts icon (the person, bottom-left)
- Sign out of GitHub, then sign back in when prompted
- Push again — VS Code handles the token behind the scenes
Don't have gh? It's a free install from cli.github.com — or use the VS Code route, which needs nothing extra.
The stale-credential trap (Windows)
Here's the sneaky one. The first time you signed in, Windows saved that login and quietly re-sends it on every push. If the saved token has expired — or was your old password — every push fails, even after you fix your account, because Git never asks you again. It just keeps replaying the stale login. The cure is to throw the saved one away:
Flush the saved login
$ git credential-manager github logout
$ # then push — you'll get a fresh sign-in prompt - No VS Code button for this — use Windows itself: Control Panel → User Accounts → Credential Manager → Windows Credentials
- Find the
git:https://github.comentry and click Remove - Push again and sign in fresh
On macOS the same login hides in Keychain Access — search for 'github' and delete the entry.
Wrong account?
A close cousin: remote: Permission to someone/project.git denied to other-user
(a 403 — web-speak for "you're signed in, but not allowed"). Git is
authenticating fine — just as the wrong person, usually a work account or an old
username saved on the machine. It's the same stale-credential trap in a different costume,
and the same fix: clear the saved login as above, push again, and sign in as the right user.
Up next: the other classic push blocker — GitHub refusing a file over 100 MB. Fix it in File Too Large to Push.