- Notifications
You must be signed in to change notification settings - Fork6
🔀 Open git/hg/svn remote url via web browser from terminal.
hotoo/gitopen
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Open git/hg/svn remote url in web browser from terminal.
Support:
- Mac OS X
- Windows
- Linux/Unix
,
- git
- hg
- svn
and
If you are useGitBucket,tell me please.
$ npm install -g gitopen
$ git remote -vorigingit@github.com:hotoo/gitopen.git (fetch)origingit@github.com:hotoo/gitopen.git (push)$ git branch* master$ cd subdir$ gitopen # Open git repository homepage, like: https://github.com/hotoo/gitopen$ gitopen :master # Open git repository on given branch name.$ gitopen -b master # Same the `:master`$ gitopen issues # https://github.com/hotoo/gitopen/issues$ gitopen #1 # https://github.com/hotoo/gitopen/issues/1$ gitopen pr # New a pull-request$ gitopen !1 # Open merge/pull request by id.$ gitopen prs # https://github.com/hotoo/gitopen/pulls, alias `pulls`, `mrs`.$ gitopen wiki # Open wiki pages.$ gitopen release # Open releases page.$ gitopen tags # Open tags page.$ gitopen commits # Open commits page.$ gitopen brs # Open branches page, alias `branchs` and `branches`.$ gitopen {hash} # Open commit page by hash code.$ gitopen README.md # Open remote blob url. default use current working branch.$ gitopen README.md -b branch # Open remote blob url by given branch.$ gitopen README.md :branch # Open remote blob url by given branch.$ gitopen path/to/dir # Open remote tree url. default use current working branch.# global command.$ gitopen @lizzie # https://github.com/lizzie$ gitopen @hotoo/gitopen # https://github.com/hotoo/gitopen
Default supportgithub.com,bitbucket.org,gitlab.com,gitea.com,gitcafe.com,coding.net,gitee.com,AntCodeand CSDNgitcode.com.
If you are useGitHub Enterprise,GitLab Community Edition (CE), GitLab Enterprise Edition (EE),Atlassian Stash,GitCafe EnterpriseYou need config in ~/.gitconfig file:
[gitopen "github.company.com"]type = githubprotocol = https[gitopen "gitlab.company.net"]type = gitlabprotocol = http
You can config it by git command-line:
; global$ git config --global gitopen.github.company.com.type github$ git config --global gitopen.github.company.com.protocol https;setlocal repo default remote name.$ git remote add gitlabRemote git@gitlab.com:hotoo/gitopen.git$ git config gitopen.remote gitlabRemote
Also you can config it in ~/.gitopenrc file for global settings:
github.company.com:type:githubprotocol:httpsgitlab.company.net:type:gitlabprotocol:http
github.company.com
,gitlab.company.net
is your company's git web server domain name.type
is the type of your company's git web server, supportgithub
,gitlab
,gitbucket
,gitea
,coding
,gitee
,gitcode
,antcode
.protocol
: protocol of your company's git web server,http
orhttps
.
Else if you are using other custom web system build your owner git server, you need config like:
git.example.com:type:customprotocol:httpscheme:issues:/path/to/issueswiki:/path/to/wikismore:[reference to github scheme](./lib/scheme/github.js)...
You can git alias in ~/.gitconfig:
[alias] open = !gitopen
Then you can use command like:
$ git open
Open git repository homepage.
Open git repository issues list page.
Open new issue with title (optional).
Open git repository issue by id.
Open git repository pulls list page.
Open pull request or merge request from given branch or current working branchfor git repository.
alias:
$ gitopen pr
$ gitopen mr
for example:
$ gitopen pr # current working branch to compare default branch.$ gitopen pr a # given branch(a) to compare default branch.$ gitopen pr a b # branch b to compare branch a.$ gitopen pr a...b # branch b to compare branch a.
Open git repository pull request or merge request by id.
alias:
$ gitopen pr1
$ gitopen mr#1
support@
,/
,#
,:
,-
or without sparator.
Open file blame information page.
Open git repository commits list page.
alias:
$ gitopen commit
$ gitopen ci
Open commit page by hash code.
Open git repository wiki home page.
alias:
$ gitopen wikis
Open git repository tags list page.
alias:
$ gitopen tag
Open git repository milestones list page.
Open git repository milestones by given id.
alias:
$ gitopen milestone@id
support@
,/
,#
,:
,-
sparator.
Open new milestone for git.
Open git repository releases list page.
alias:
$ gitopen release
Open new release by tag name.
Edit release by tag name.
Open given file on given branch, default use current working branch.
alias:
$ gitopen filename :branch
$ gitopen filename -b branch
Open given directory on given branch, default use current working branch.
alias:
$ gitopen directory :branch
$ gitopen directory -b branch
[LOCAL COMMAND] Open new snippet.
[GLOBAL COMMAND] Openhttps://gist.github.com/
alias:
$ gitopen snip
$ gitopen gist
Open network page.
[GLOBAL COMMAND] Open profile page on GitHub.
[GLOBAL COMMAND] Open given repository homepage on GitHub.
Support all of gitopen in repository local commands (not support global commands), like:
$ hgopen
open homepage.$ hgopen issues
open issues list page.$ hgopen #id
op issues by id.- ...
Open svn repository on current working directory.
Specify file/directory path, default is current working directory.
If you want open a file or directory name is reserved words, likeissues
andpr
, you can use--path
option instead.
$ gitopen -p issues$ gitopen --path pr
Specify git/hg branch name, default is current working branch.
Specify git remote name, default isorigin
.
Display detail information for debug.
sudo apt-get install xdg-utils --fix-missing
If this tool is useful for you, pleaseStar this repository.
And maybe you want to donate me via Alipay / WeChat:
Thank you.
About
🔀 Open git/hg/svn remote url via web browser from terminal.