configuration
config files
/etc/git/gitconfig or C:\Program Files\Git\etc\gitconfig — config for all users on the system (--system)~/.git — config for all repositories of the current user (--global).git/ — config for this repository only (--local (default))
configuration commands
git config [scope] <key> <value> set configuration <key> to <value>
checking configuration
git config --list — list all configuration settings Git can find- Note: Git uses the last value for each unique key it sees
git config <key> return the value of <key>git config --show-origin <key> return the origin (configuration file) of <key> and its value
One-Time Config
git config --global user.name "<name>" — set your usernamegit config --global user.email <email address> — set your email addressgit config --global init.defaultBranch <name> –set the default branch to <name> (recommend main)git config --global core.editor "<path>" — set the default editor used when Git needs inputgit config --global credential.helper cache set up a credential cache
aliases
git config --global alias.<alias> '<command>' — create <alias> for <command string>git config --global alias.last 'log -1 HEAD' — return the last commit via last
common aliases
git config --global alias.co checkoutgit config --global alias.br branchgit config --global alias.ci commitgit config --global alias.st status