Skip to content

Instantly share code, notes, and snippets.

@erikmd
Last active September 10, 2024 23:03
Show Gist options
  • Save erikmd/6d6ed568233816d50a066177a042adc0 to your computer and use it in GitHub Desktop.
Save erikmd/6d6ed568233816d50a066177a042adc0 to your computer and use it in GitHub Desktop.
@erikmd's recommended Git configuration

Recommended Git configuration

Run these standard commands anytime you setup git on a new workstation.

Mandatory

git config --global user.name "Prénom Nom"
git config --global user.email "[email protected]"

Recommended

git config --global push.default upstream
git config --global pull.rebase false  # = merge by default, can still do "git pull -r"
git config --global color.ui auto
git config --global rebase.stat true
git config --global merge.log true
git config --global merge.conflictstyle diff3

# THEN ONLY ONE LINE AMONG:

# VsCode
git config --global core.editor "code --new-window --wait"
# Emacs
git config --global core.editor emacs 
# Vim
git config --global core.editor vim
# Nano
git config --global core.editor nano
# TextEdit on MacOS
git config --global core.editor "open -e -n -W"  # to close, use ⌘-Q, not ⌘-W

Verification

git config --global -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment