-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases.txt
19 lines (19 loc) · 1.21 KB
/
aliases.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[alias]
co = checkout
br = branch
ec = config --global -e
publish = "!git push -u origin $(git branch-name)"
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'SAVEPOINT'
wip = commit -am "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
default = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
bclean = "!f() { DEFAULT=$(git default); git branch --merged ${1-$DEFAULT} | grep -v " ${1-$DEFAULT}$" | xargs git branch -d; }; f"
bdone = "!f() { DEFAULT=$(git default); git checkout ${1-$DEFAULT} && git up && git bclean ${1-$DEFAULT}; }; f"
migrate = "!f(){ DEFAULT=$(git default); CURRENT=$(git symbolic-ref --short HEAD); git checkout -b $1 && git branch --force $CURRENT ${3-'$CURRENT@{u}'} && git rebase --onto ${2-$DEFAULT} $CURRENT; }; f"
lastmod = "!git ls-tree -r --name-only HEAD -z | TZ=UTC xargs -0n1 -I_ git --no-pager log -1 --date=iso-local --format=\"%ad _i\" -- _ | sort -r"
squash-all = "!f(){ git reset $(git commit-tree HEAD^{tree} -m "${1:-A new start}");};f"