Giter Club home page Giter Club logo

git-open's Introduction

git-open

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

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

git open2015-01-24 13_51_18

Installation

Without using a framework

The preferred way of installation is to simply add the git-open script somewhere into your path (e.g. add the directory to your PATH environment or copy git-open into an existing included path like /usr/local/bin).

You can use also npm to install an OLD (1 year ago) version of this package:

npm install --global git-open

Using a ZSH Framework

Add antigen bundle paulirish/git-open to your .zshrc with your other bundle commands.

Antigen will handle cloning the plugin for you automatically the next time you start zsh, and periodically checking for updates to the git repository. You can also add the plugin to a running zsh with antigen bundle paulirish/git-open for testing before adding it to your .zshrc.

  1. cd ~/.oh-my-zsh/custom/plugins
  2. git clone [email protected]:paulirish/git-open.git
  3. Add git-open to your plugin list - edit ~/.zshrc and change plugins=(...) to plugins=(... git-open)

Add zgen load paulirish/git-open to your .zshrc file in the same function you're doing your other zgen load calls in. ZGen will take care of cloning the repository the next time you run zgen save, and will also periodically check for updates to the git repository.

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

Supported remote repositories

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

  • github.com
  • gist.github.com
  • gitlab.com
  • Gitlab custom hosted (see below)
  • bitbucket.org
  • Atlassian Bitbucket Server (formerly Atlassian Stash)

Gitlab support

To configure gitlab support globally 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]

Related projects / alternatives

See hub for complete GitHub opening support. It's the official GitHub project and provides hub browse.

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

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

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

Thanks

jasonmccreary did all the hard work

See the contributors tab for a growing list of people who have submitted PRs.

Contributing

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

License

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

Changelog

  • 2016-07-23 - readme -- fix oh-my-zsh install instructions
  • 2016-07-22 - 1.1.0, update and add linters for package.json, readme. Re-publish to NPM.
  • 2016-07-11 - Changelog started (readme formatting and installation instructions updated)

git-open's People

Contributors

paulirish avatar davidosomething avatar bbeardsley avatar jasonmccreary avatar unixorn avatar naereen avatar eush77 avatar nwinkler avatar frosas avatar jensaronsson avatar olegafx avatar pborenstein avatar redwolves avatar rcmachado avatar oluckyman avatar

Watchers

Standa Opichal avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.