@latest_post
Basic Git configuration
To show where you global config file is:
git config --list --show-origin
Set up our user and email:
git config --global user.name "Your name goes here"
git config --global user.email "your@email.goes.here"
Set the default branch name for your new repos:
git config --global init.defaultBranch main
Always git pull with rebase:
git config --global pull.rebase true
Let's have colored output for git status and git diff:
git config --global color.ui "auto"
Enable the automatic detection of CPU threads to use when packing repositories:
git config --global pack.threads "0"
Define a global .gitignore file:
git config --global core.excludesfile ~/.config/git/globalexcludes
Let's use it to ignore vscode project files and files generated by the ElixirLS plugin:
echo ".vscode/" >> ~/.config/git/globalexcludes
echo ".elixir_ls/" >> ~/.config/git/globalexcludes
echo ".impeccable/" >> ~/.config/git/globalexcludes