I'm using someone else's laptop with vscode, and while I'm able to push to my github repos, it comes up under their name which makes my github account look inactive.
The integrated terminal in VSCode looks like: Bob's Macbook:(directory name) Bob
Therefore, when I push to my repos, it appears as if Bob
is making commits to my repos when it's actually me. As a result, my 'recent activity' chart on my profile doesn't look like I've been committing, which isn't ideal.
I couldn't find where to change the user in VSCode settings, so I figured I'd post it here in case someone ran into the same issue.
How do I get my github username connected to my VSCode terminal?
In VS Code press Ctrl + Shift + p to see the command palette and write the symbol > , after that you can see any command you need including the sign out command to work with this extension.
I found an article on github that answered my question. There's just two easy steps in the setting your commit email in git
section.
All you have to do is first run:
git config --global user.email "[email protected]"
Don't use quotation marks, just put your desired email in and make sure it's associated with your github account (Github > Profile > Settings > Email > Add Email)
Then check to see if it worked with:
git config --global user.email
Which should return your email. You'll see your next commit in your profile.
As mentioned in the comments below, you should also run that command with user.name
to change the name attached to the commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With