From 4feb945bb31801802704b6ec004f000d052eadf4 Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Wed, 14 Sep 2022 03:11:28 +0530 Subject: git add & push fzf alias --- .config/shell/aliasrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.config/shell/aliasrc b/.config/shell/aliasrc index 4be0a3f..7ae5e29 100644 --- a/.config/shell/aliasrc +++ b/.config/shell/aliasrc @@ -22,11 +22,16 @@ alias \ polkit='/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1' #git +#to escape single quotes -> replace ' with '\'' +#The following wont work: +#cut -d ' ' -f4 +#awk '{print "$2"}' +#cut -d\ -f4 alias \ - g1='git add .' \ + g1='git add "$(git status | grep modified: | cut -d'\'' '\'' -f4 | fzf)"' \ gr='git restore --staged' \ g2='git commit -S -m' \ - g3='git push origin HEAD --force' \ + g3='git push "$(git remote show | fzf)" HEAD' \ gs='git status' \ gd='git diff --staged' \ gu='git remote update && git status -uno' \ -- cgit v1.2.3