Last active
October 11, 2018 08:41
-
-
Save davidnaviaweb/c132e69476da4d6dbd89a8253821a2c2 to your computer and use it in GitHub Desktop.
Git aliases for .gitconfig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
# logs | |
l = log --pretty=format:"%C(Yellow)%H\\ %C(reset)%ad\\ %C(Green)%cr%C(reset)%x09\\ %Cred%d\\ %C(Cyan)%an:\\ %C(reset)%s" --decorate --date=format:%c | |
lg= log --graph --oneline --decorate --all | |
# add | |
a = add | |
au = add -u | |
ap = add -p | |
aa = add . | |
# commit | |
c = commit --verbose | |
ca = commit -a --verbose | |
cm = commit -m | |
cam = commit -a -m | |
m = commit --amend --verbose | |
# add & commit | |
ac = !git add -A && git commit -m | |
auca = !git add -u && git commit --amend | |
aum = !git add -u && git commit -m | |
# diff | |
d = diff | |
ds = diff --stat | |
dc = diff --cached | |
# push | |
p = push | |
po = push --set-upstream | |
# pull | |
pl = pull | |
gpla = pull --all | |
# status | |
s = status -s | |
# checkout | |
co = checkout | |
cob = checkout -b | |
# branch | |
bd = branch -d | |
bdf = branch -D | |
# stash | |
sh = stash | |
shs = stash save | |
shp = stash pop | |
shl = stash list | |
# 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/--'" | |
# delete all merged branches | |
clb = "!git branch --merged | egrep -v '(^\\*|master|development)' | xargs git branch -d" | |
# list aliases | |
la = "!git config -l | grep alias | cut -c 7-" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment