🌱 BasicsCommonly used
How to configure Git
Set up your name, email, editor and other Git preferences.
Set your name
git config --global user.name "Your Name"Sets the name that appears on your commits globally.
When to use: First thing to set after installing Git.
Set your email
git config --global user.email "you@example.com"Sets the email that appears on your commits globally.
Set default editor
git config --global core.editor "code --wait"Sets VS Code as the default editor for commit messages and interactive rebases.
For vim: use vim. For nano: use nano.
Set default branch name
git config --global init.defaultBranch mainMakes "main" the default branch name for all new repositories.
View all config settings
git config --listShows all current Git configuration values.
Set up pull with rebase by default
git config --global pull.rebase trueMakes git pull rebase by default instead of creating merge commits.
When to use: For a cleaner linear history.