git config

Updated: 27 December 2025

https://git-scm.com/docs/git-config


Username and email

git config --global user.name "John Doe"
git config --global user.email "who@ever.cloud"

Colours

git config --global color.status.updated magenta
git config --global color.status.untracked magenta
git config --global color.diff.old magenta

Set vim as default editor

git config --global core.editor "vim"

Temporarily switch to another ssh private key

git --config "core.sshCommand=ssh -i /home/mruser/.ssh/id_rsa" fetch

Default to git merge --no-ff branch_name

git config --global merge.ff no

Leave a comment