config/git: add sf alias using fzf

This commit is contained in:
xeruf 2021-06-24 22:07:50 +02:00
parent f6c6a1752c
commit d00dd95668
2 changed files with 3 additions and 2 deletions

View File

@ -73,6 +73,7 @@
stb = status --short --branch
sv = --paginate status -v
svv = --paginate status -vv
sf = !git diff-index HEAD --name-only | fzf --preview='git diff HEAD --color=always -- {}' --multi | git commit -v --pathspec-from-file=-
r = remote -v
b = branch -vv
@ -94,7 +95,7 @@
#dir = !git root | sed 's/$/\\/.git/' | grep --color=never "/" # grep ensures a proper exit status on fail
lg = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --graph
lgo = lg HEAD @{push}
lgu = lg HEAD @{push}
lo = log --pretty=tformat:'%C(auto)%h%d %s %Cgreen(%cd) %Cblue<%an>%Creset' --date=human --no-merges
lp = log -p --date=local
ln = !git --no-pager lo "-$(a=$(git rev-list --count HEAD...@{push} 2>/dev/null); expr $a + 3 \\& ${a:-0} \\> 3 \\| 6)" --color=always --graph HEAD @{u} 2>/dev/null | head -9 || git --no-pager lo -7

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Cleans up remote branches and removes branches where the remote-tracking branches got removed.
git fetch -p &&
git fetch --prune &&
for branch in `git branch -vv | grep ": gone]" | cut -d" " -f3`
do git branch -D "$branch"
done