mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-15 17:56:17 -04:00
Stash remote URLs always contain /scm/, I'm using that to detect a repo hosted on Stash. The web URL for Stash repos is using a different format, where it inserts "projects" and "repos" to separate the project and the repo. I had to move the branch detection to the top, since Stash is using a different format for selecting the branch. I've only tried this with HTTPS URLs, not with git: URLs - there's probably some more code needed for this. |
||
|---|---|---|
| git-open | ||
| README.md | ||
git-open
A command-line script to open the GitHub page, or website for a repository.
Usage
git open [remote-name] [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
Installation
Put the bash script in ~/bin/ and make sure that folder's in your PATH.
curl -o ~/bin/git-open https://raw.githubusercontent.com/paulirish/git-open/master/git-open
chmod +x ~/bin/git-open
Thx
@jasonmccreary did all the hard work
License
Copyright Jason McCreary & Paul Irish. Licensed under MIT.
