Skip to content

Instantly share code, notes, and snippets.

@tangoslee
Last active January 7, 2020 00:39
Show Gist options
  • Save tangoslee/90b29db5bef71731f35a25b5e7140aad to your computer and use it in GitHub Desktop.
Save tangoslee/90b29db5bef71731f35a25b5e7140aad to your computer and use it in GitHub Desktop.
~/.gitconfig
[core]
editor = vim
autocrlf = false
eol = LF
fileMode = false
[user]
email = <email here>
name = <username>
[push]
default = matching
[alias]
logs = log --graph --oneline --decorate --date-order --pretty=format:"%Cred%h%Creset\\ -%C(yellow)%d\\ %Creset%s\\ %Cgreen(%cr)\\ %C(cyan)<%an>%Creset"
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%C(cyan)\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%C(cyan)\\ [%cn]" --decorate --numstat
lnc = log --pretty=format:"%h\\ %s\\ [%cn]" --decorate
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%C(cyan)\\ [%cn]" --decorate --date=short
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%C(cyan)\\ [%cn]" --decorate --date=relative
lsb = for-each-ref --sort=-committerdate refs/remotes/origin/
llb = for-each-ref --sort=-committerdate refs/heads/ --format='%(authordate:short) %(color:red)%(objectname:short) %(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))'
filelog = log -u
#
fl = log -u
# Show modified files in last commit:
dl = "!git ll -1"
# Show a diff last commit;
dlc = diff --cached HEAD^
# Reset
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
nah = !git reset --hard && git clean -df
# http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/
[diff]
renamelimit = 5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment