jannis-baum / git.zsh-dotfiles

zsh functions to blaze through git & GitHub workflows

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

git.zsh dotfiles

This repository holds all my git and GitHub related zsh functions that let me blaze through my workflow.

Example features

  • gsi: interactive git status viewer with diff viewer, (un)staging toggles, a commit button, and a file reset button
  • ghi: 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 & issue
  • ghpr: create/open GitHub PR for current branch, automatically adds body text to close corresponding issue if applicable
  • gl: interactive git log viewer with instant rebasing and both a summary and detailed diff viewer
  • gco: interactive git checkout that automatically creates local from remote branches and abstracts away the difference between them
  • gpp: 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!

Configuration

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.

Usage

Find instructions for how to use this plugin below

Requirements

To use all features, you need to have the following tools installed and in your $PATH.

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.

Installation

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.

About

zsh functions to blaze through git & GitHub workflows


Languages

Language:Shell 100.0%