Skip to content

Instantly share code, notes, and snippets.

@arnaudjolly
Last active June 26, 2019 12:51
Show Gist options
  • Save arnaudjolly/7c6e4ac27423635a2f34e287d90869f0 to your computer and use it in GitHub Desktop.
Save arnaudjolly/7c6e4ac27423635a2f34e287d90869f0 to your computer and use it in GitHub Desktop.
git aliases I frequently use
[alias]
br = branch
ci = commit
cl = clone
co = checkout
cp = cherry-pick
diff = diff --word-diff
dc = diff --cached
gr = grep -Ii
st = status -sb
;list aliases
la = "!git config -l | grep alias | cut -c 7-"
lsg = log --color --graph --pretty=format:'%C(yellow)%h %ad%C(red)%d %C(reset)%s %C(green)(%cr) %C(bold blue)[%an]%C(reset)' --abbrev-commit --date=short
top = log --color --graph --pretty=format:'%C(yellow)%h %ad%C(red)%d %C(reset)%s %C(green)(%cr) %C(bold blue)[%an]%C(reset)' --abbrev-commit --date=short --all -5
ll = log --pretty=format:'%C(yellow)%h %ad%C(red)%d %C(reset)%s %C(green)(%cr) %C(bold blue)[%an]%C(reset)' --decorate --numstat
;find path pattern
f = "!git ls-files | grep -i"
;diff on specific revision
dr = "!f() { git diff \"$1\"^..\"$1\"; }; f"
;list content of revision
lc = "!f() { git ll \"$1\"^..\"$1\"; }; f"
lasttag = describe --tags --abbrev=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment