VS Code keeps signing commits with wrong GitHub account even after SSH + config reset #177887
-
BodyHey everyone 👋 I’m running into a super confusing issue with VS Code and GitHub authentication. Here’s what I’ve done so far:
But somehow, commits still show the old username and avatar on GitHub after pushing 🤯 Am I missing something about how VS Code handles GitHub authentication or cached credentials? #MukeshDeepDive Guidelines
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Alright, I finally cracked this one after digging way too deep 😤 Turns out it’s not Git’s fault — it’s VS Code (and Windows credential caching). 🧩 1. Clear VS Code’s stored GitHub credentialsOn Windows, VS Code stores GitHub tokens in the Credential Manager.
Then restart VS Code. 🔐 2. Re-authenticate the correct GitHub accountAfter restarting, VS Code will ask to sign in again when you push or pull. ⚙️ 3. Verify SSH key and identityRun this in your terminal: ssh -T git@github.com
If it shows the wrong username, your SSH agent might still be using the old key.
Fix that by restarting the agent and adding the right key:
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519_new
🧾 4. Double-check your repo config
Inside your project folder:
git config user.name
git config user.email
git remote -v
If those look correct, push again:
git commit -m "Test commit"
git push
✅ After that, my commits finally started showing under the right GitHub profile.
Apparently, VS Code remembers old auth tokens even if you fix your Git setup —
so cleaning out those credentials was the real fix.
Hope this helps someone else stuck in the same rabbit hole 🧠💻 |
Beta Was this translation helpful? Give feedback.
Alright, I finally cracked this one after digging way too deep 😤
Turns out it’s not Git’s fault — it’s VS Code (and Windows credential caching).
Here’s what fixed it for me step by step:
🧩 1. Clear VS Code’s stored GitHub credentials
On Windows, VS Code stores GitHub tokens in the Credential Manager.
To clear them:
Then restart VS Code.
🔐 2. Re-authenticate the correct GitHub account
After restarting, VS Code will ask to sign in again when you push or pull.
👉 Make sure you choose the right GitHub account this time.
⚙️ 3. Verify SSH key and identity
Run this in your terminal: