Last active
August 10, 2016 16:12
-
-
Save kivikakk/0ff314f4d20ad52b027dee9f0334c124 to your computer and use it in GitHub Desktop.
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] | |
# Note that that /w$/ variants tend to be those *without* -w. Same for | |
# /n$/ variants where appropriate. | |
s = status -sb | |
h = show -w | |
hs = show --stat | |
h1 = show -w HEAD~1 | |
h2 = show -w HEAD~2 | |
h3 = show -w HEAD~3 | |
h4 = show -w HEAD~4 | |
h5 = show -w HEAD~5 | |
h6 = show -w HEAD~6 | |
h7 = show -w HEAD~7 | |
h8 = show -w HEAD~8 | |
h9 = show -w HEAD~9 | |
h10 = show -w HEAD~10 | |
hw = show | |
l = log --show-notes="*" --abbrev-commit --pretty=format:'%Cred%h %Cgreen(%aD)%Creset -%C(bold red)%d%Creset %s %C(bold blue)<%an>%Creset' | |
la = !git l --all | |
lg = !git l --graph | |
lag = !git la --graph | |
# "w" for "write". "v" because it's close to "w" on Dvorak. | |
v = pull | |
w = push | |
wf = push --force-with-lease | |
wu = push -u | |
wo = push -u origin | |
woo = push origin | |
tx = "!fn() { git push -u $1 $(git symbolic-ref HEAD | sed s_^refs/heads/__); }; fn" | |
wx = "!fn() { git push $1 $(git symbolic-ref HEAD | sed s_^refs/heads/__); }; fn" | |
t = !git tx origin | |
wm = push -u origin master | |
tfx = "!fn() { git push -uf $1 $(git symbolic-ref HEAD | sed s_^refs/heads/__); }; fn" | |
wfx = "!fn() { git push --force-with-lease $1 $(git symbolic-ref HEAD | sed s_^refs/heads/__); }; fn" | |
tf = !git tfx origin | |
wn = push origin refs/notes/* | |
f = fetch | |
a = add -p | |
ad = add | |
ada = !git ad -A | |
b = branch | |
ba = branch -a | |
bd = branch -d | |
bdd = branch -D | |
co = checkout | |
cf = checkout FETCH_HEAD | |
cb = checkout -b | |
pc = checkout -p | |
c = commit | |
ca = commit -a | |
cam = commit -a -m | |
cm = commit -m | |
cx = commit --amend | |
d = diff -w | |
dom = diff -w origin/master | |
dw = diff | |
dc = diff --cached -w | |
dcw = diff --cached | |
dm = diff -w master | |
bl = blame | |
m = merge | |
mf = merge FETCH_HEAD | |
mm = merge master | |
mom = merge origin/master | |
mnf = merge --no-ff | |
mt = mergetool | |
st = stash save | |
sta = stash apply | |
stl = stash list | |
stp = stash pop | |
sth = stash show -p | |
std = stash drop | |
r = reset | |
rh = reset --hard | |
e = revert -n | |
en = revert | |
rb = rebase | |
rba = rebase --abort | |
rbc = rebase --continue | |
rbs = rebase --skip | |
ri = rebase -i | |
r2 = rebase -i HEAD~2 | |
r3 = rebase -i HEAD~3 | |
r4 = rebase -i HEAD~4 | |
r5 = rebase -i HEAD~5 | |
r5 = rebase -i HEAD~5 | |
r6 = rebase -i HEAD~6 | |
r7 = rebase -i HEAD~7 | |
r8 = rebase -i HEAD~8 | |
r9 = rebase -i HEAD~9 | |
r10 = rebase -i HEAD~10 | |
rbm = rebase master | |
rbmi = rebase master -i | |
rbf = rebase FETCH_HEAD | |
ara = remote add | |
rv = remote -v | |
rrm = remote rm | |
rpo = remote prune origin | |
# These are so-named to avoid conflicts with normal shell commands. | |
mrm = rm | |
vmv = mv | |
pcp = cherry-pick | |
sm = submodule | |
sma = submodule add | |
smi = submodule init | |
smu = submodule update | |
sms = submodule sync | |
n = notes | |
bs = bisect start | |
bg = bisect good | |
bb = bisect bad | |
br = bisect reset | |
p = grep |
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
# Note that [alias] must be the last section in ~/.gitconfig for this to work well. | |
grep -A1000 '\[alias\]' ~/.gitconfig | grep -Ev '^[ ]*(#|$|\[alias\])' | sed -e 's_^[ ]*__g' -e 's_[ ]*=.*$__' -e 's_^\(.*\)$_alias \1="git "\1_' > ~/.profile.aliases | |
source ~/.profile.aliases |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment