0.0.5 • Published 9 years ago
git-open-cws v0.0.5
git-open
Type git open
to open the GitHub page or website for a repository in your browser.
Usage
git open [remote-name or "ticket"] [branch-name]
Examples
$ git open
> open https://github.com/REMOTE_ORIGIN_USER/CURRENT_REPO/tree/CURRENT_BRANCH
$ git open upstream
> open https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/tree/CURRENT_BRANCH
$ git open upstream master
> open https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/tree/master
$ git open ticket
> open https://customredminedomain.com/issues/99999
Installation
Install with NPM:
brew install npm
npm install --global git-open-cws
Manual Installation:
# Clone the git repo
cd /usr/local/etc/bash_completion.d/
git clone git@gitlab.cws.oregonstate.edu:nunezro/git-open.git
# Place the following function in your .bashrc or equivalent
git() {
if [[ $1 == "open" ]]; then
command /usr/local/etc/bash_completion.d/git-open/git-open ${@#open}
else
command git "$@"
fi
}
# Then enable git autocompletion by appling patch.2.2.0.git-completion.bash.txt
# to your local copy of git-completion.bash
$ cd /usr/local/etc/bash_completion.d/
$ patch < git-open/patch.2.2.0.git-completion.bash.txt
Supported:
- Github.com
- Gists on Github
- Bitbucket
- Atlassian Stash
- Gitlab.com
- Gitlab custom hosted (see below)
- Redmine issues (see below)
Gitlab support
To configure gitlab support (when default doesn't work) you need to set gitopen.gitlab.domain:
git config --global gitopen.gitlab.domain [yourdomain.here]
# or
git config gitopen.gitlab.domain [yourdomain.here] # in your local repository
Redmine support
To configure redmine support (when default doesn't work) you need to set gitopen.redmine.domain:
git config --global gitopen.redmine.domain [yourdomain.here]
# or
git config gitopen.redmine.domain [yourdomain.here] # in your local repository
Adaptation
Adapted for use by Oregon State University Central Web Services by Roberto Nunez
Thx
@jasonmccreary did all the hard work
License
Copyright Jason McCreary & Paul Irish. Licensed under MIT.