- First time settings
- Name
- Email
- Default editor
- Line Endings
- You can specify settings at different levels
- System: All users
- Global: All repositories of current user
- Local: Current repository
Config Name
git config --global user.name "Ganesh Kumar"
Config email
git config --global user.email example@gmail.com
Config default editor
git config --global core.editor "code --wait"
Open git configuration
- Configurations are stored in
.gitconfig
file
git config --global -e
Config Line endings
On Windows
- On windows end of line are marked with
\r\n
.
\r
carriage return
\n
line feed
- When user checks in code, git should remove carriage return from end of line
- When user checkout code, git should update end of line and add carriage return.
git config --global core.autocrlf true
On Mac & Linux
- On mac & linux end of line are marked with
\n
- When user checks in code, git should remove carriage return if the editor adds it
- When user checks out, no need for carriage return. git should not touch end of line.
git config --global core.autocrlf input