Skip to content

Instantly share code, notes, and snippets.

@niepiekm
Last active September 15, 2023 09:29
Show Gist options
  • Save niepiekm/ea5a06e5bb9af3ee2b66e110f59ed066 to your computer and use it in GitHub Desktop.
Save niepiekm/ea5a06e5bb9af3ee2b66e110f59ed066 to your computer and use it in GitHub Desktop.
[user]
name = Marek Niepieklo
email = xxx@yyy.zzz
[alias]
alias = "!f() {[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1}; f"
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
amend = commit --amend -m
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
br = branch
brd = branch -d
brD = branch -D
cl = clone
ci = commit
cm = commit -m
co = checkout
cob = checkout -b
cp = cherry-pick
df = diff --word-diff
dfc = diff --stat
dfs = diff --cached
fxu = "!f() { git cm \"$@\" && git rbmi; }; f"
fxup = "!f() { git fxu && git puf; }; f"
new = !git log $1@{1}..$1@{0} "$@"
pl = pull
pld = pull --recurse-submodules
po = push origin
# pm = push origin HEAD:refs/for/master
pu = !git push origin $(git branch --show-current)
puf = !git push --force origin $(git branch --show-current)
puu = !git push -u origin `git branch --show-current`:`git branch --show-current`
rb = rebase
rbi = rebase -i
rba = rebase --abort
rbc = rebase --continue
# rbim = rebase -i master
# rbm = rebase master
rbm = !git rebase $(git rev-parse --abbrev-ref $(git symbolic-ref refs/remotes/origin/HEAD) | awk -F'/' '{print $2}')
rbmi = !git rbm -i
rbimn = rebase -i main
rbmn = rebase main
st = status
sts = status -s
sl = stash list
sa = stash apply
ss = stash save
subup = submodule update --init --recursive
who = shortlog -s --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment