To remove your old GitHub account from your PC and add a new account, you'll need to follow these steps:
-
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
-
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 withid_rsa
orid_dsa
and delete the ones associated with your old account.
- If you've added SSH keys for your old account and want to remove them, you can delete them from your
-
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"
-
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
-
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)