diff options
author | Erich Eckner <git@eckner.net> | 2022-01-08 11:19:48 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2022-01-08 11:19:48 +0100 |
commit | 0ccea4da66dc4cae98b640e4ad906f429e3a353b (patch) | |
tree | 232e23d2ec9bc7ad998c64898e661b72956e0d39 /git-fzf | |
parent | 522c8cb129904ec9d5098a880fcc1d2bc942b846 (diff) | |
download | even-more-utils-0ccea4da66dc4cae98b640e4ad906f429e3a353b.tar.xz |
add some useful git commands
Diffstat (limited to 'git-fzf')
-rwxr-xr-x | git-fzf | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +#!/bin/bash + +if [ "$1" = '--local' ] || [ "$1" = '-l' ]; then + shift + git_options='' + sed_prefix='' +else + git_options='--remote' + sed_prefix='origin/' +fi + +git branch ${git_options} 2>/dev/null \ +| sed ' + s@^..'"${sed_prefix}"'@@ + t + d +' \ +| fzf \ +| if [ "$#" -gt 0 ]; then + xargs -r git "$@" +else + cat +fi |