summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-10-31 02:21:52 -0400
committerJesse Luehrs <doy@tozt.net>2017-10-31 10:30:15 -0400
commitbd8e845d459149525b1a12f50e61c868444a30df (patch)
treeed0d5143b073f4ac5e6aef26249cc3871a3771a4
parentf3527a3f2ae5938366b80f1052b729a930712a78 (diff)
downloadconf-bd8e845d459149525b1a12f50e61c868444a30df.tar.gz
conf-bd8e845d459149525b1a12f50e61c868444a30df.zip
add a fzf alias for switching git branches
-rw-r--r--gitconfig2
1 files changed, 2 insertions, 0 deletions
diff --git a/gitconfig b/gitconfig
index 97b1eb8..1aeb072 100644
--- a/gitconfig
+++ b/gitconfig
@@ -6,6 +6,8 @@
aliases = !git config --get-regexp 'alias.*' | perl -nle'/^alias\\.([^ ]*) (.*)/ && printf \"%-15s = %s\\n\", $1, $2'
alias = "!f() { local name=$1; shift; git config --global alias.$name \"$*\"; }; f"
amend = !git add -p && git commit --amend
+ b = "!f() { git show-ref --heads --dereference | awk '{print $2}' | sed 's|refs/heads/||' | fzf --height 5 | xargs git co; }; f"
+ bd = "!f() { git show-ref --heads --dereference | awk '{print $2}' | sed 's|refs/heads/||' | fzf --height 5 | xargs git branch -D; }; f"
blame-stats = !~/.bin/git/git-blame-stats
br = for-each-ref --sort=committerdate refs/heads/ --format='%(align:30,left)%(HEAD) %(refname:short)%(end) %(color:green)(%(committerdate:relative))'
cc = cherry-pick