choco install git
For Powershell also set the HOME
environment variable, as per this
answer on StackOverflow.
setx HOME c:\Users\<your_user_name>
brew update
brew install git
sudo apt update
sudo apt upgrade
sudo apt install git
sudo yum upgrade
sudo yum install git
Alternatively follow the Official Documentation 🗗
The most common way to configure git is to change the global configuration for a user on a machine.
Assuming this is what we want to achieve, the --global
flag is used.
Let's all just agree that we only need \n
characters.
To not enforce this globally we keep end of line enforcement at native but disable autocrlf.
git config --global core.eol native
git config --global core.autocrlf input
git config --global user.name <your-username>
git config --global user.email <your-email-address>
The recommended way of connecting to a git repository is by using ssh key, protected by a password. Note that you might end up typing this password a few times a day so don't make it too long.
There is an excellent documentation by github on how to create and configure an ssh key 🗗.
git config --global color.ui auto
git config --global color.branch auto
git config --global color.status auto
# Never rebase branches that are team-shared
git config --global branch.main.rebase false
git config --global branch.master.rebase false
git config --global branch.develop.rebase false
# Always rebase feature branches
git config --global branch.autosetuprebase always