60 lines
1.0 KiB
Markdown
60 lines
1.0 KiB
Markdown
# Configure Git User
|
|
|
|
This recipe configures the Git author identity used when creating commits.
|
|
|
|
## Verify Current Configuration
|
|
|
|
```bash
|
|
git config --global --get user.name
|
|
git config --global --get user.email
|
|
```
|
|
|
|
## Configure Global Identity
|
|
|
|
Replace the values below with your own information.
|
|
|
|
```bash
|
|
git config --global user.name "Jota Odiceu"
|
|
git config --global user.email "jotaodiceu@odinetwork.com.br"
|
|
```
|
|
|
|
## Verify Configuration
|
|
|
|
```bash
|
|
git config --global --list | grep user
|
|
```
|
|
|
|
Expected output:
|
|
|
|
```text
|
|
user.name=Jota Odiceu
|
|
user.email=jotaodiceu@odinetwork.com.br
|
|
```
|
|
|
|
## Repository Specific Configuration
|
|
|
|
Override the global identity for a single repository.
|
|
|
|
```bash
|
|
git config user.name "Another Name"
|
|
git config user.email "another@email.com"
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Git still uses another email
|
|
|
|
Check where the value comes from.
|
|
|
|
```bash
|
|
git config --show-origin --get user.email
|
|
```
|
|
|
|
If the repository has a local configuration, it overrides the global one.
|
|
|
|
### Verify all configuration
|
|
|
|
```bash
|
|
git config --list --show-origin
|
|
```
|