los-romka / zsh-jira-checkout-branch

MIT License
4 stars 0 forks source link

zsh-jira-checkout-branch

Zsh plugin for easy navigation between git branches associated with JIRA issues

This is written as a zsh plugin, it also works with bash if you follow the manual installation instructions.

Installation

As an Oh My ZSH! custom plugin

Clone zsh-jira-checkout-branch into your custom plugins repo

git clone https://github.com/los-romka/zsh-jira-checkout-branch ~/.oh-my-zsh/custom/plugins/zsh-jira-checkout-branch

Then load as a plugin in your .zshrc

plugins+=(zsh-jira-checkout-branch)

Keep in mind that plugins need to be added before oh-my-zsh.sh is sourced.

Then define required JIRA variables

Manually

Clone this repository somewhere (~/.zsh-jira-checkout-branch for example)

git clone https://github.com/los-romka/zsh-jira-checkout-branch.git ~/.zsh-jira-checkout-branch

Then source it in your .zshrc (or .bashrc)

source ~/.zsh-jira-checkout-branch/zsh-jira-checkout-branch.plugin.zsh

Then define required JIRA variables

Required

Put $JIRA_USER:$JIRA_PASS into ~/.jira-credentials

echo "user:pass" > ~/.jira-credentials

Define JIRA_API_URL in your .zshrc (or .bashrc)

echo -e "JIRA_API_URL=https://jira.mysite.com/rest/api/2/" >> ~/.zshrc

Usage

Just type jco in your Git-repository to checkout between branches (fzf included)

Options

Custom Directory

You can specify a custom JIRA_CREDENTIALS_PATH in your .zshrc (or .bashrc)

echo -e "JIRA_CREDENTIALS_PATH=~/.jira-credentials" >> ~/.zshrc

Dependencies

License

MIT © Roman Los