Home >Development Tools >git >How to change user in git
How to switch Git users
Question: How to switch Git users?
Answer: To switch Git users, you can use the git config
command.
Detailed steps:
<code>git config --global user.name "Your Name"</code>
<code>git config --global user.email "your@email.com"</code>
<code>git config --global --list</code>
You should see a file containing the changes you just configured Output list of usernames and email addresses.
Example:
If you wish to set your Git username to "John Doe" and email to "john.doe@example.com", Then you can run the following command:
<code>git config --global user.name "John Doe" git config --global user.email "john.doe@example.com"</code>
After switching Git users, you can use the new credentials to commit and push code.
The above is the detailed content of How to change user in git. For more information, please follow other related articles on the PHP Chinese website!