Skip to content

Instantly share code, notes, and snippets.

@itsPG
Last active September 12, 2022 01:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save itsPG/dd5eb9d12885bf2fe842 to your computer and use it in GitHub Desktop.
Save itsPG/dd5eb9d12885bf2fe842 to your computer and use it in GitHub Desktop.
git config
# User
git config --global user.name YOUR_NAME
git config --global user.email YOUR_EMAIL@gmail.com
git config --global core.editor vim
# Common
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
# Diff
git config --global alias.wdf "diff --color-words"
git config --global alias.df "diff --color-words='.'"
# Advanced
git config --global alias.cp cherry-pick
git config --global alias.fp format-patch
git config --global alias.pr "pull --rebase"
git config --global alias.mg merge
git config --global alias.smg "merge --squash"
git config --global alias.cia "commit --amend"
git config --global alias.rc "rebase --continue"
git config --global alias.ri "rebase -i"
# Log
git config --global alias.la "log --graph --decorate --pretty=oneline --abbrev-commit --all"
git config --global alias.ll "log --graph --decorate --pretty=oneline --abbrev-commit"
git config --global alias.lf "log --stat --decorate --format=fuller abbrev-commit"
# Colors
git config --global color.ui auto
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.log auto
# Features
git config --global rerere.enabled true
git config --global push.default simple
#git config --global branch.autosetuprebase always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment