zsh git plugin - 01-27-20

I use git exclusive from the command line and while it’s interface is very clear since I spend so much time I’m willing to trade some of that clarity for speed. ZSH has a great plugin for really fast git tasks. Two of my favorite are pushing while setting a upstream branch and adding patches.

GPSUP, git set upstream and push shortcut

I push new git branches a few times a day and my previous work flow was to:

$ gp
fatal: The current branch NOTICKET-XXX has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin NOTICKET-XXX

followed by the classic fuck command:

$ fuck

which then runs the proper push command setting upstream. News flash! This call all be accomplished with a single plugin command:

$ gpsup

GAPA, git add patch

I like small commits and the key to that for me is adding by patch. This short cut turns

$ git add --patch

to

$ gapa

Can’t recommend the zsh git plugin enough! There are too many shortcut commands to be worth memorizing but I think gpsup and gapa are worth it. For a big list of commands it checkout the docs here

\- [ git, zsh ]