git config --global alias.co checkout git config --global alias.br branch git config --global alias.ci commit git config --global alias.st status git config --global alias.lg "log --oneline --graph --all --decorate" Visualize history exactly how you need it.

# ~/.gitconfig [includeIf "gitdir:~/work/"] path = ~/.gitconfig-work Extend beyond Git — create shell functions that wrap Git commands, like git recent to show last 5 branches.

git config --global alias.tree "log --graph --pretty=format:'%C(yellow)%h%C(red)%d %C(white)%s %C(blue)(%ar by %an)' --all" Use external diff tools like difftastic for structural diffs, or configure Git to ignore whitespace in specific file types.

git config --global diff.external difft Pre-commit hooks (using lefthook or pre-commit ) can lint, format, and test before code reaches your repo. 5. Conditional Includes Apply different Git configs based on directory or branch. Perfect for separating work and personal projects.

close
Scroll to Top