Skip to content

Instantly share code, notes, and snippets.

@shacker

shacker/.gitconfig

Last active May 28, 2018
Embed
What would you like to do?
shacker .gitconfig aliases
[alias]
alias = config --get-regexp ^alias\\.
br = branch
bra = branch -a -v -v
cm = commit -a
co = checkout
cp = cherry-pick
dev = checkout develop
find = "!f() { git ls-files |grep $@; }; f"
last = log -1 HEAD
lasttag = describe --tags --abbrev=0
log1 = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
log2 = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
ls = ls-files
r = remote -v -v
rem = "!git config -l | grep remote.*url | tail -n +2"
rev = merge --no-ff --no-commit
s = status
sb = status -sb
squash = merge --squash
sl = stash list
sa = stash apply
ss = stash save
tags = tag -n
# undo
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
unstage = reset HEAD --
# conflict/merges
ours = "!f() { git co --ours $@ && git add $@; }; f"
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment