readme rejiggle 🏋

This commit is contained in:
Paul Irish 2016-08-05 15:47:41 -07:00 committed by GitHub
parent 2523ce5db1
commit 76193236a2

View file

@ -1,31 +1,34 @@
# git-open
Type `git open` to open the GitHub page or website for a repository in your
browser.
Type `git open` to open the repo website (Github, Gitlab, Bitbucket) in your browser.
![git open2015-01-24 13_51_18](https://cloud.githubusercontent.com/assets/39191/5889192/244a0b72-a3d0-11e4-8ab9-55fc64228aaa.gif)
## Usage
git open [remote-name] [branch-name]
git open issue
```sh
git open [remote-name] [branch-name]
git open issue
```
(`git open` works with these [hosted repo providers](#supported-remote-repositories), `git open issue` currently only works with Github)
### Examples
$ git open
> open https://github.com/REMOTE_ORIGIN_USER/CURRENT_REPO/tree/CURRENT_BRANCH
```sh
$ git open
# opens 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
# opens 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 upstream master
# opens https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/tree/master
On a branch with the naming convention of issues/#123
$ git open issue
> open https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/issues/123
![git open2015-01-24 13_51_18](https://cloud.githubusercontent.com/assets/39191/5889192/244a0b72-a3d0-11e4-8ab9-55fc64228aaa.gif)
$ git open issue
# If branches use naming convention of issues/#123,
# opens https://github.com/REMOTE_UPSTREAM_USER/CURRENT_REPO/issues/123
```
### Installation
@ -37,16 +40,19 @@ or copy `git-open` into an existing included path like `/usr/local/bin`).
You can use also `npm` to install this package:
npm install --global git-open
```sh
npm install --global git-open
```
#### Using Windows Powershell
Save git-open anywhere, say as ~/Documents/Scripts/git-open.sh and define
a function in your Powershell profile (see ~/Documents/WindowsPowerShell/profile.ps1) like this:
function git-open { cmd /c "C:\Program Files\Git\usr\bin\bash.exe" "~/Documents/Scripts/git-open.sh" }
Set-Alias -Name gop -Value git-open
```sh
function git-open { cmd /c "C:\Program Files\Git\usr\bin\bash.exe" "~/Documents/Scripts/git-open.sh" }
Set-Alias -Name gop -Value git-open
```
#### Using a ZSH Framework
@ -92,13 +98,12 @@ git-open can automatically guess the corresponding repository page for remotes
#### Gitlab support
To configure gitlab support globally you need to set `gitopen.gitlab.domain`
To configure gitlab support you need to set `gitopen.gitlab.domain`:
git config --global gitopen.gitlab.domain [yourdomain.here]
or in your local repository:
git config gitopen.gitlab.domain [yourdomain.here]
```sh
# use --global to set across all repos, instead of just the local one
git config [--global] gitopen.gitlab.domain [yourdomain.here]
```
## Related projects / alternatives
@ -117,10 +122,7 @@ from which this plugin was forked.
## Thanks
[jasonmccreary](https://github.com/jasonmccreary/) did
[all the hard work](https://github.com/jasonmccreary/gh)
See the contributors tab for a growing list of people who have submitted PRs.
[jasonmccreary](https://github.com/jasonmccreary/) did [the initial hard work](https://github.com/jasonmccreary/gh). Since then, [many contributors](https://github.com/paulirish/git-open/graphs/contributors) have submitted great PRs.
## Contributing