Git Configuration

Configuring Git settings

User Settings

git config --global user.name 'Your Name'
git config --global user.email '[email protected]'
git config --global core.editor vim # set default editor

Aliases

git config --global alias.co checkout # create alias
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status

Line Endings

git config --global core.autocrlf true # Windows
git config --global core.autocrlf input # Mac/Linux

Color Output

git config --global color.ui auto # enable colors

Default Branch

git config --global init.defaultBranch main # set default branch name

View Config

git config --list # show all settings
git config --global --list # show global settings
git config user.name # show specific setting