config/git: order aliases

This commit is contained in:
xerus2000 2020-12-12 16:51:14 +01:00
parent 5638127ff7
commit 1b77c3e93e
2 changed files with 36 additions and 23 deletions

View File

@ -50,28 +50,23 @@
lowSpeedTime = 3 lowSpeedTime = 3
[alias] [alias]
# GET INFO
st = status -sb st = status -sb
stv = --paginate status -v stv = --paginate status -v
stvv = --paginate status -vv stvv = --paginate status -vv
sta = stash
stl = stash list
sts = stash show -v
stp = stash pop
std = stash drop
r = remote -v r = remote -v
b = branch -vv b = branch -vv
ba = b -a ba = b -a
ref = reflog ref = reflog
rev = rev-parse --short rev = rev-parse --short
head = rev-parse --short HEAD head = rev-parse --short HEAD
root = rev-parse --show-toplevel root = rev-parse --show-toplevel
dir = rev-parse --git-dir dir = rev-parse --git-dir
curbranch = symbolic-ref --short HEAD curbranch = symbolic-ref --short HEAD
upstream = !git rev-parse --abbrev-ref --symbolic-full-name @{upstream} || git rev-parse --abbrev-ref --symbolic-full-name @{push} || echo origin/$(git curbranch)
f = fetch #dir = !git root | sed 's/$/\\/.git/' | grep --color=never "/" # grep ensures a proper exit status on fail
fa = fetch --all
lg = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --graph lg = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --graph
lo = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges lo = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges
@ -81,38 +76,51 @@
co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++' co-authors = !git log | grep -i Co-Authored | awk '!a[$0]++'
when = git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ # List all branches with their last updates when = git for-each-ref --sort=committerdate --format='%(refname:short) * %(authorname) * %(committerdate:relative)' refs/remotes/ # List all branches with their last updates
dir = !git root | sed 's/$/\\/.git/' | grep --color=never "/" # grep ensures a proper exit status on fail # Local Changes
upstream = !git rev-parse --abbrev-ref --symbolic-full-name @{upstream} || git rev-parse --abbrev-ref --symbolic-full-name @{push} || echo origin/$(git curbranch)
sup = !git branch --set-upstream-to @{push}
a = add -u a = add -u
aa = add -u . aa = add -u .
ap = add -p ap = add -p
c = commit -v c = commit -v
co = checkout co = checkout
cb = checkout -b cb = checkout -b
cp = cherry-pick cp = cherry-pick
rb = rebase rb = rebase
rbc = rebase --continue rbc = rebase --continue
p = push
pf = push --force-with-lease sta = stash
fs = !git fetch && git st stl = stash list
lu = !git pull upstream $(git curbranch) sts = stash show -v
luu = !git pull upstream $(git curbranch) && git push --no-verify stp = stash pop
cap = git commit --all --amend --no-edit && git push --force-with-lease std = stash drop
rh = reset HEAD~ rh = reset HEAD~
rs = reset --keep rs = reset --keep
ru = reset --keep @{upstream} ru = reset --keep @{upstream}
rg = rmgonebranches
unstage = reset HEAD -- unstage = reset HEAD --
gcr = !git gc && git repack -a -d
ready = rebase -i @{push}
format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop format-head = !git stash && git-clang-format HEAD~ && git commit -a --amend --no-edit && git stash pop
# Housekeeping
gcr = !git gc && git repack -a -d
sup = !git branch --set-upstream-to @{push}
# Update from remote
f = fetch
fa = fetch --all
fs = !git fetch && git st
lu = !git pull upstream $(git curbranch)
rg = rmgonebranches
sm = submodule update --init --recursive sm = submodule update --init --recursive
# Change remote
luu = !git pull upstream $(git curbranch) && git push --no-verify
p = push
pf = push --force-with-lease
cap = git commit --all --amend --no-edit && git push --force-with-lease
# COMMIT SHORTHANDS
cme = commit -v --edit --message cme = commit -v --edit --message
# yadm # yadm
cgit = !yadm cme "config/git:" -- $XDG_CONFIG_HOME/git/config $CONFIG_SHELLS/git $HOME/.local/bin/git-* cgit = !yadm cme "config/git:" -- $XDG_CONFIG_HOME/git/config $CONFIG_SHELLS/git $HOME/.local/bin/git-*

5
.local/bin/git-ready Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Interactive rebase onto the remote
remote="$1"
shift
git rebase -i ${remote:-'@{push}'} "$@"