Change Git User Name and Email in 3 Steps
- Open your terminal and navigate to your git repository.
- Change Git user name by running:
git config user.name “Your Name”
- Change Git user email by running:
git config user.email “name@email.com”
With these easy steps you will be able to change the git user name and git user email. Keep in mind that these instructions are used to change the git user name and email for a particular repository.
To change the global git user name and email you have to add the --global
parameter to the commands. Here is an example of how to change git user name and email globally:
- Open your terminal and navigate to your git repository.
- Change Git user name by running:
git config --global user.name “Your Name”
- Change Git user email by running:
git config --global user.email “name@email.com”
Git Configuration (Git Config)
The git config
command can be used to interact with the configuration of a git repository. You can review all the git configurations by running git config --list
command.
Here are some examples of values that are stored on git’s config object:
- File excluder. “.gitignore” by default.
- A set of git aliases to perform commands faster.
- The default merge tool.
- The git user name and email.
- The credentials used to connect to git.
- The list of remotes from a git repository.
As an example, here is how to get the git repository URL in 2 steps:
- Open terminal and navigate to git repository.
- Run the command:
git config remote.origin.url