This repository holds all my git and GitHub related zsh functions that let me blaze through my workflow.
gsi
: interactive git status viewer with diff viewer, (un)staging toggles, a commit button, and a file reset buttonghi
: interactive GitHub issue viewer with button to check out/create branch linked to issue,ghio
to open issue for current branch,ghir
to rename current branch & issueghpr
: create/open GitHub PR for current branch, automatically adds body text to close corresponding issue if applicablegl
: interactive git log viewer with instant rebasing and both a summary and detailed diff viewergco
: interactive git checkout that automatically creates local from remote branches and abstracts away the difference between themgpp
: git pull with automatic deletion of remote branches that no longer exist- automatic copying of corresponding GitHub issue reference as conventional commit scope when committing so you can make your commits show up right in the issue timeline and stay super organized
- lots of small aliases & functions to save keystrokes on common commands such
as opening the remote URL, non-interactive (un)staging & committing,
git rebase --continue
,git stash [pop]
,git push [-f]
, and many more
Check out the commented .zsh
files for more detailed info!
Some of the fzf-based functions such as gsi
use fzf-keybindings that you can
customize by setting variables in your .zshrc
. See
options.zsh
for the list of all keybindings and their default
values.
Find instructions for how to use this plugin below
To use all features, you need to have the following tools installed and in your
$PATH
.
git
, of coursefzf
- the GitHub CLI
- ripgrep (
rg
)
On top of these, this plugin relies on you having your $EDITOR
variable set to
whatever command you use to open your text editor. If you use
si-vim for example, you should have
export EDITOR=siv
in your .zshenv
file.
With all requirements available, simply source all .zsh
files from this repo
in your .zshrc
, for example like this
for script in $(find '<path to this repo>' -name '*.zsh'); do
source $script
done
I do this by keeping this repository as a submodule in my
dotfiles. If you want to do this,
I recommend using my tool
sdf
to manage your
dotfiles and their dependencies.