From 76193236a2de4b31d12f62842392c933d1f641c5 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Fri, 5 Aug 2016 15:47:41 -0700 Subject: [PATCH] =?UTF-8?q?readme=20rejiggle=20=F0=9F=8F=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 60 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index e6d8d1c..45e1f69 100644 --- a/README.md +++ b/README.md @@ -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