Home > front end >  changing github account in terminal
changing github account in terminal

Time:01-28

how to change my github account in terminalIn the image you can see dhamo2002 which is not my account. i have no idea how this account get connected that is my brother account

I have tried so many times using git config and ssh key method but that doesn't work.

All i need is I need to connect my github account 'yuvaraj787' in place of 'dhamo2002'. I am new to git and github. It will be nice if someone understand what i am saying and help. thanks!.

CodePudding user response:

some useful commands:

git config --global --get user.email

git config --global --get user.name

git config --global --get-all

but to answer your question

git config --global --unset user.email
git config --global --unset user.name

will remove the current profile.

&

git config --global --add user.email [email protected]
git config --global --add user.name YOURUSERNAME123

will get your actual profile set up :)

and to get you the rest of the way:

git config --global --help

hint: have your personal access token (PAT) handy for reconfiguring your profile to your shell

CodePudding user response:

GitHub's offical Managing multiple accounts should help.

In [Contributing to multiple accounts using HTTPS and personal access tokens](Contributing to multiple accounts using HTTPS and personal access tokens) section you can learn how to

use different personal access tokens for each account by configuring Git to store different credentials for each repository.

The section also covers how to clear the current credentials.

  • Related