Skip to content

Instantly share code, notes, and snippets.

@kino90
Created October 16, 2019 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kino90/3cc0e80c8072477a9f96c33782b1d547 to your computer and use it in GitHub Desktop.
Save kino90/3cc0e80c8072477a9f96c33782b1d547 to your computer and use it in GitHub Desktop.
Git configuration file with useful alias
[core]
autocrlf = input
ignorecase = false
[user]
name = YourName
email = your.email.address@example.com
[alias]
# fetch
f = fetch
# status
st = status
s = status -s
# checkout
co = checkout
cob = checkout -b
# add
a = add
ap = add -p
# diff
d = diff
ds = diff --stat
dc = diff --cached
# commit
c = commit --verbose
ca = commit -a --verbose
cm = commit -m
cam = commit -a -m
m = commit --amend --verbose
# reset
r = reset
rh = reset --hard
# list branches sorted by last modified
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
# list aliases
la = "!git config -l | grep alias | cut -c 7-"
# logging
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment