diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-09-14 03:11:28 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-09-14 03:11:28 +0530 |
commit | 4feb945bb31801802704b6ec004f000d052eadf4 (patch) | |
tree | b7f11c9f19f60b9ecab343387c0547ec74ec00aa | |
parent | 5c533c95520798bec1258c7276a6a0cd02cdd096 (diff) |
git add & push fzf alias
-rw-r--r-- | .config/shell/aliasrc | 9 |
1 files 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' \ |