DEV Community

Raihanul Islam Sharif
Raihanul Islam Sharif

Posted on

Github Old Account remove from Pc and Login New Account

To remove your old GitHub account from your PC and add a new account, you'll need to follow these steps:

  1. Removing Old Account Credentials:

    • Open Git Bash or any terminal you're using.
    • Enter the following command to remove the old account credentials:
     git config --global --unset credential.helper
    
  2. Removing SSH Keys (Optional):

    • If you've added SSH keys for your old account and want to remove them, you can delete them from your ~/.ssh directory. Look for files starting with id_rsa or id_dsa and delete the ones associated with your old account.
  3. Adding New Account:

    • Open Git Bash or any terminal you're using.
    • Set your new username and email globally by entering the following commands:
     git config --global user.name "raihanuldev"
     git config --global user.email "rihanthedev@gmail.com"
    
  4. Confirming Changes:

    • To confirm that the old account has been removed and the new account has been added, you can run:
     git config --global --list
    
  5. Testing New Account:

    • Try cloning a repository or performing any action that requires authentication. Git will prompt you to enter your credentials for the new account.

Following these steps should effectively remove your old GitHub account credentials from your PC and add the new account credentials.

Top comments (0)