bitbucket-git-helpers
Some git helper scripts for dealing with repos on bitbucket that were inspired by Peter Hurford's git-it-on.zsh plugin.
Note: This has only been tested on OS X. Support for Linux is present but has not been tested.
The irony that I'm hosting this on Github hasn't escaped me.
Contents
Table of Contents generated with DocToc
- Included Scripts
- git-bb-create-pull-request
- git-bb-list-pull-requests
- git-bb-open
- Installing
- Antigen
- oh-my-zsh
- zgen
- Manual Installation
Included Scripts
git-bb-create-pull-request
Usage:
git-bb-create-pull-request
- opens the bitbucket page to create a new PR for the branch you're on.
git-bb-list-pull-requests
Usage:
git-bb-list-pull-requests
- opens the bitbucket pull-request page for the repository.
git-bb-open
Usage:
git-bb-open
- Opens the current directory (or a path if specified) on bitbucket in the current branch.
git-bb-open path
- Opens the specified path on bitbucket in the current branch.
Installing
Antigen
If you're using Antigen:
- Add
antigen bundle unixorn/bitbucket-git-helpers.plugin.zsh
to your.zshrc
where you've listed your other plugins. - Close and reopen your Terminal/iTerm window to refresh context and use the plugin. Alternatively, you can run
antigen bundle unixorn/bitbucket-git-helpers.plugin.zsh
in a running shell to have antigen load the new plugin.
oh-my-zsh
If you're using oh-my-zsh:
In the command line, change to oh-my-zsh's custom plugin directory :
cd ~/.oh-my-zsh/custom/plugins/
Clone the repository into a new
bitbucket-git-helpers
directory:git clone https://github.com/unixorn/bitbucket-git-helpers.plugin.zsh.git bitbucket-git-helpers
Edit your
~/.zshrc
and addbitbucket-git-helpers
– same as clone directory – to the list of plugins to enable:plugins=( ... bitbucket-git-helpers.plugin.zsh )
Then, restart your terminal application to refresh context and use the plugin. Alternatively, you can source your current shell configuration:
source ~/.zshrc
zgen
If you're using zgen:
- Add
zgen load unixorn/bitbucket-git-helpers.plugin.zsh
to your.zshrc
along with your otherzgen load
commands. rm ${ZGEN_INIT}/init.zsh && zgen save
Manual Installation
Nothing here actually requires you to use ZSH or zgen, that's just a convenient distribution method for anyone using a ZSH framework.
If you aren't using any zsh frameworks, or if you're a bash user, do the following steps:
- git clone this repository
- Add
cloneDirectory/bin
to your$PATH
.