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.