Here are some common Git configuration examples:
-
Setting User Information:
git config --global user.name "Your Name" git config --global user.email "your.email@example.com" -
Setting the Default Text Editor:
git config --global core.editor "nano" -
Enabling Color Output:
git config --global color.ui auto -
Setting Up Aliases:
git config --global alias.co checkout git config --global alias.br branch git config --global alias.ci commit -
Configuring Line Endings:
git config --global core.autocrlf true # For Windows git config --global core.autocrlf input # For macOS/Linux -
Setting the Default Push Behavior:
git config --global push.default simple -
Configuring Credential Caching:
git config --global credential.helper cache -
Setting the Default Branch Name:
git config --global init.defaultBranch main
These configurations help customize your Git environment and improve your workflow.
