This guide will talk about the method of logging out from the Git command line.
How to Git Log Out Users From Command Line?
To log out from the Git command line, developers are required to remove their credentials, such as βuser.nameβ and βuser.emailβ by executing the βgit config –global –unset user.<name/email>β command.
Follow the below-stated process to perform the above-listed query!
Step 1: Switch to Desired Git Repository
At first, run the βcdβ command along with the local repository path and move to it:
Step 2: Check Configured User Name
Next, to view the command line configured user name, execute the βgit configβ command along with the β–globalβ option and βuser.nameβ parameter:
According to the below-given output, βmariaβ is configured as a user name:
Step 3: Unset Configured User Name
Now, run the below-listed command to remove the user name from the Git configuration file:
Here, the β–unsetβ option is used for deleting the current user name:
Step 4: Verify Remove User Name
Then, ensure the removed user name by running the following command:
It can be observed that the user name has been successfully removed from the configuration file:
Step 5: View Configured User Email Address
Now, check the saved user email address with the help of the βgit configβ command:
Step 6: Unset User Email Address
Next, run the βgit configβ command β–unsetβ option to remove the user email address from the Git configuration file:
Step 7: Ensure Unset Operation
Lastly, verify whether the user email address has been removed or not:
We have illustrated the process of logging out from the Git command line.
Conclusion
To log out from the Git command line, first, move to the Git folder and check the existing user name. Then, execute the βgit config –global –unset user.nameβ command to remove and verify it. After that, view the current user email address and unset it by running the βgit config –global –unset user.emailβ command. This guide explained the procedure of logging out from the Git command line.