Git config username and email
To set your username and email in Git, you can use the following commands:
Set your username:
git config --global user.name "Your Name"
Replace "Your Name" with your actual name.
Set your email:
git config --global user.email "[email protected]"
Replace "[email protected]" with your actual email address.
The --global
flag tells Git to store the configuration in your system-wide Git configuration file, which is usually located at ~/.gitconfig
on Unix-based systems or C:\Users\YourUsername\.gitconfig
on Windows.
If you want to set the username and email for a specific repository only, you can omit the --global
flag and use the following commands:
git config user.name "Your Name"
git config user.email "[email protected]"
These settings will be stored in the .git/config
file in the root directory of your repository.
Note that you only need to set your username and email once, as Git will remember them for future use.