dotfiles/git/.config/git/gitalias.ini

72 lines
1.6 KiB
INI

[alias]
# Core short aliases
a = add
b = branch
c = commit
d = diff --output-indicator-new=' ' --output-indicator-old=' '
f = fetch
l = log --all --graph --pretty=format:'%C(magenta)%h %C(white) %an %ar%C(auto) %D%n%s%n'
m = merge
o = checkout
p = pull
r = restore
cleanout = "!git restore --staged . && git restore ."
rs = restore --staged
s = status
ush = push
# Frequently used commands
aa = add --all
ap = add --patch
au = add --update
# Branch commands
bm = branch --merged
bnm = branch --no-merged
# Commit commands
ca = commit --amend
cane = commit --amend --no-edit
cm = "!sh $XDG_CONFIG_HOME/git/commit.sh"
# Checkout shortcuts
co = checkout
con = checkout --no-guess
# Cherry-pick
cp = cherry-pick
cpa = cherry-pick --abort
cpc = cherry-pick --continue
# Diff tools
dc = diff --cached
ds = diff --staged
# Status shortcuts
ss = status --short
ssb = status --short --branch
s = "!clear -x; git status; git log --oneline -4"
# Pull shortcuts
pr = pull --rebase
# Rebase helpers
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbs = rebase --skip
rbi = rebase --interactive @{upstream}
# Show incoming/outgoing changes
incoming = !git remote update --prune; git log ..@{upstream}
outgoing = log @{upstream}..
# Reset to upstream (shorter name)
rtu = reset --hard @{upstream}
# Clean everything to be pristine
cleanest = clean -ffdx
# Useful helpers
aliases = "!git config --get-regexp '^alias\\.' | cut -c 7- | sed 's/ / = /'"
lasttag = describe --tags --abbrev=0