Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Type `git open` to open the GitHub page or website for a repository in your browser.

License

NotificationsYou must be signed in to change notification settings

githubFeature/git-open

 
 

Repository files navigation

Typegit open to open the repo website (GitHub, GitLab, Bitbucket) in your browser.

Demo of git open in action

Usage

git open [remote-name] [branch-name]git open --issue

(git open works with thesehosted repo providers,git open --issue currently only works with GitHub, Visual Studio Team Services and Team Foundation Server)

Examples

$ git open# opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/tree/CURRENT_BRANCH$ git open someremote# opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/tree/CURRENT_BRANCH$ git open someremote somebranch# opens https://github.com/PROVIDED_REMOTE_USER/CURRENT_REPO/tree/PROVIDED_BRANCH$ git open --issue# If branches use naming convention of issues/#123,# opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/issues/123

Installation

Basic install

The preferred way of installation is to simply add thegit-open scriptsomewhere into your path (e.g. add the directory to yourPATH environmentor copygit-open into an existing included path like/usr/local/bin).

Install via NPM:

npm install --global git-open

Windows Powershell

Save git-open anywhere, say as ~/Documents/Scripts/git-open.sh and definea function in your Powershell profile (see ~/Documents/WindowsPowerShell/profile.ps1) like this:

functiongit-open { cmd /c"C:\Program Files\Git\usr\bin\bash.exe""~/Documents/Scripts/git-open.sh" }Set-Alias -Name gop -Value git-open

Windows withcmd terminal

Save thegit-open script in any place accessible via your%PATH% environment var.

ZSH

Addantigen bundle paulirish/git-open to your.zshrc with your other bundlecommands.

Antigen will handle cloning the plugin for you automatically the next time youstart zsh, and periodically checking for updates to the git repository. You canalso add the plugin to a running zsh withantigen bundle paulirish/git-openfor testing before adding it to your.zshrc.

  1. git clone https://github.com/paulirish/git-open.git $ZSH_CUSTOM/plugins/git-open
  2. Addgit-open to your plugin list - edit~/.zshrc and changeplugins=(...) toplugins=(... git-open)

Addzgen load paulirish/git-open to your .zshrc file in the same functionyou're doing your otherzgen load calls in. ZGen will take care of cloningthe repository the next time you runzgen save, and will also periodicallycheck for updates to the git repository.

zplug "paulirish/git-open", as:plugin

Supported remote repositories

git-open can automatically guess the corresponding repository page for remotes(default looks fororigin) on the following hosts:

  • github.com
  • gist.github.com
  • gitlab.com
  • GitLab custom hosted (see below)
  • bitbucket.org
  • Atlassian Bitbucket Server (formerlyAtlassian Stash)
  • Visual Studio Team Services
  • Team Foundation Server (on-premises)

Configuration

See theman page for more information on how to configuregit-open.

Alternative projects

Seehub for complete GitHub opening support.It's the official GitHub project and provideshub browse.

Homebrew has an alternate git-openthat only works with GitHub but can open user profile pages, too.

@gerep has an alternate git-open thatworks with a few providers. Of note, it opens the default view for BitBucketinstead of the source view.

And, of course,jasonmccreary's original ghfrom which this plugin was forked.

Thanks

jasonmccreary didthe initial hard work. Since then,many contributors have submitted great PRs.

Contributing & Development

Please provide examples of the URLs you are parsing with each PR.

You can rungit-open inecho mode, which doesn't open your browser, but just prints the URL to stdout:

env BROWSER='echo' ./git-open

Testing:

You'll need to installbats, the Bash automated testing system. It's also available asbrew install bats

git submodule update --init# pull in the assertion libraries# Run the test suite once:batstest# or `npm run unit`# Run it on every change with `entr`brew install entrnpm run watch

Related projects

License

Copyright Jason McCreary & Paul Irish. Licensed under MIT.http://opensource.org/licenses/MIT

Changelog

  • 2017-12-01 - 2.0 shipped. Breaking change:Gitlab configuration handled differently.
  • 2017-12-01 - Configuration for custom remote added
  • 2017-11-30 - Support for VSTS Added
  • 2017-10-31 ---issue and-h added
  • 2017-10-30 - Configuration for custom domains added
  • 2017-10-30 - WSL support added
  • 2017-06-16 - Introduced a test suite in BATS
  • 2017-06-15 - Entire script rewritten and simplified by @dermagia
  • 2016-07-23 - Readme: fix oh-my-zsh install instructions
  • 2016-07-22 - 1.1.0 shipped. update and add linters for package.json, readme.
  • 2016-07-11 - Readme formatting and installation instructions updated. Changelog started

About

Type `git open` to open the GitHub page or website for a repository in your browser.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell100.0%

[8]ページ先頭

©2009-2025 Movatter.jp