I am currently utilizing Windows 10 Pro. My intention is to create commits using my friend’s GitHub account. To achieve this, I removed the GitHub credentials from the credential manager. However, when I logged in with my friend’s account, I realized that although I was given permission to push to his repository, the commits were still being made from my account. Therefore, I am seeking guidance on how to log out of my user account and log in with the new user account.
Removing git:https://github.com, doesn’t help
3 Answers
Introduction
GitHub is a popular platform for version control and code management. It allows developers to collaborate on projects and share their code with others. When working with GitHub, it is important to ensure that your commits are being made from the correct account. In this blog post, we will discuss why your commits may be coming from a signed-out GitHub account and how to log out of your user account completely.
Why are my commits coming from a signed-out GitHub account?
There can be several reasons why your commits are still being made from your account even after signing out. One of the most common reasons is that your Git configuration is still using your credentials. Git is a command-line tool that is used to interact with GitHub. When you sign out of GitHub, Git may still be using your credentials to authenticate your commits.
Another reason could be that you are using a cached version of your credentials. When you authenticate with GitHub, your credentials are cached locally on your computer. This is done to make it easier for you to access your account in the future. However, if you sign out of GitHub, the cached credentials may still be used to authenticate your commits.
How to log out of your user account completely?
To log out of your user account completely, you need to follow these steps:
Step 1: Clear your Git configuration
The first step is to clear your Git configuration. To do this, you need to open your Git Bash terminal and run the following command:
git config --global --unset-all user.name
git config --global --unset-all user.email
This will remove all your Git configurations, including your user name and email address.
Step 2: Clear your cached credentials
The next step is to clear your cached credentials. To do this, you need to open the Credential Manager on your computer. You can do this by searching for “Credential Manager” in the Start menu.
Once you have opened the Credential Manager, you need to look for any cached credentials related to GitHub. Select the credential and click on “Remove”. Repeat this process for all cached credentials related to GitHub.
Step 3: Log out of GitHub
The final step is to log out of GitHub. To do this, you need to open your web browser and navigate to the GitHub website. Click on your profile picture in the top-right corner and select “Sign out” from the dropdown menu.
Once you have signed out of GitHub, you can log in with your friend’s account and start making commits from their account.
Conclusion
In conclusion, if your commits are still being made from your account even after signing out of GitHub, it could be due to your Git configuration or cached credentials. To log out of your user account completely, you need to clear your Git configuration, clear your cached credentials, and log out of GitHub. By following these steps, you can ensure that your commits are being made from the correct account.
To log out of a GitHub account on a computer running Windows 10, you can follow these steps:
- Open the GitHub Desktop application.
- Click on the “File” menu and select “Options”.
- In the “Options” window, click on the “Accounts” tab.
- Under the “GitHub.com” section, click on the “Sign Out” button.
Alternatively, you can log out of your GitHub account by revoking the access token that GitHub Desktop is using to authenticate you. To do this, follow these steps:
- Open the GitHub Desktop application.
- Click on the “File” menu and select “Options”.
- In the “Options” window, click on the “Advanced” tab.
- Under the “Authentication” section, click on the “Revoke token” button.
Once you have logged out of your account or revoked the access token, you will be able to log in with a different account by clicking on the “Sign In” button in the “Options” window.
If you are using the command line to push commits to a repository, you can log out of your account by deleting the credentials stored in the git-credential-store
. To do this, open a terminal window and enter the following command:
git credential-store --delete
This will delete the credentials stored in the git-credential-store
, and you will be prompted to enter your login credentials the next time you push commits to a repository.
I hope this helps! Let me know if you have any further questions.
GitHub accounts are irrelevant to Git. When making commits, Git uses the name and email address specified in the configuration.
The git config command can be used to modify the global configuration:
git config --global user.name "My Name"
git config --global user.email "[email protected]"
Removing --global
will set these for a single repository only.