In git, you can use the config command to modify the name user name. This command is used to configure the git configuration file. Use it with "user.name" to set the user name. The syntax is "git config --global user.name "username"".
The operating environment of this article: Windows 10 system, Git version 2.30.0, Dell G3 computer.
How to modify name user name in git
First, git config --list: Enter this command in the terminal to see your user name and email address .
is as follows:
2. If your Git has not been initialized yet, you can use this command:
$ git config --global user.name "Enter your username"
$ git config --global user.email "Enter your email"
This way you can directly configure your username and email.
3. If it has been initialized and needs to be modified, I checked a lot on the Internet when I modified the user name and email, but I couldn't solve the problem. Maybe because it is a Linux system, many people use this command:
git config --replace-all user.name"username"
git config --replace-all user.email"your email"
This appears The problem is as follows:
4. My code to solve this problem:
git config --global --replace-all user.email "my email "
git config --global --replace-all user.name "Username"
Finally, use git config --list to verify whether the modification is successful as follows:
Recommended study: "Git Tutorial"
The above is the detailed content of How to modify name username in git. For more information, please follow other related articles on the PHP Chinese website!