• Stars
    star
    3,297
  • Rank 13,612 (Top 0.3 %)
  • Language
    Shell
  • License
    MIT License
  • Created almost 10 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

git-open Build Status

Type git 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]
    # Open the page for this branch on the repo website

git open --commit
git open -c
    # Open the current commit in the repo website

git open --issue
git open -i
    # If this branch is named like issue/#123, this will open the corresponding
    # issue in the repo website

git open --print
git open -p
    # Only print the url at the terminal, but don't open it

(git open works with these hosted 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

$ git open --print
# prints https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/tree/CURRENT_BRANCH

$ git open --suffix pulls
# opens https://github.com/TRACKED_REMOTE_USER/CURRENT_REPO/pulls

Installation

Basic install

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).

Install via NPM:

npm install --global git-open

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

Windows with cmd terminal

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

ZSH

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. git clone https://github.com/paulirish/git-open.git $ZSH_CUSTOM/plugins/git-open
  2. Add git-open to your plugin list - edit ~/.zshrc and change plugins=(...) to plugins=(... git-open)
  3. source ~/.zshrc

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:plugin

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)
  • Visual Studio Team Services
  • Team Foundation Server (on-premises)
  • AWS Code Commit

Configuration

See the man page for more information on how to configure git-open.

Alternative projects

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 the 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.

Testing:

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

git submodule update --init # pull in the assertion libraries

# Run the test suite once:
bats test  # or `npm run unit`

# Run it on every change with `entr`
brew install entr
npm run watch

Related projects

License

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

Changelog

  • 2018-12-03 - 2.1.0 shipped.
  • 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

More Repositories

1

lite-youtube-embed

A faster youtube embed.
JavaScript
4,633
star
2

dotfiles

paul's fish, bash, git, etc config files. good stuff.
Shell
4,106
star
3

matchMedia.js

matchMedia polyfill for testing media queries in JS
JavaScript
2,374
star
4

memory-stats.js

minimal monitor for JS Heap Size via performance.memory
JavaScript
2,087
star
5

pwmetrics

Progressive web metrics at your fingertipz
TypeScript
1,247
star
6

break-on-access

break on access to a property
JavaScript
1,152
star
7

github-email

Get a GitHub user's email. 😎 Use this responsibly.
Shell
982
star
8

git-recent

See your latest local git branches, formatted real fancy
Shell
917
star
9

automated-chrome-profiling

Node.js recipes for automating javascript profiling in Chrome
JavaScript
863
star
10

speedline

Calculate the speed index from devtools performance trace
JavaScript
792
star
11

headless-cat-n-mouse

Is headless chrome currently detectable? Let's pit the detections and detection evasions against eachother.
JavaScript
640
star
12

css3please

use Autoprefixer instead. <3
JavaScript
386
star
13

frontend-feeds

OPML of the frontend development rss feeds
350
star
14

devtools-addons

see the wiki
292
star
15

devtools-timeline-model

Unsupported
JavaScript
172
star
16

w3fools

CSS
152
star
17

harmony

Procedural Drawing Tool - my fork reduces it down to be integrated elsewhere
JavaScript
145
star
18

es-modules-todomvc

ES modules demo app
JavaScript
127
star
19

sample-devtools-theme-extension

A sample devtools theme extension using the new API
CSS
113
star
20

web-feature-availability

estimating the % of web users that have certain web features natively supported
HTML
91
star
21

adb_trace

Android Debug Bridge + Chrome Tracing
Python
86
star
22

trace.cafe

easy webperf trace sharing
JavaScript
84
star
23

lh-scorecalc

Lighthouse perf score calculator - explaining how the perf score is composed
JavaScript
82
star
24

emulation-popup-ext

chrome extension for devtools device emulation of your current page
JavaScript
75
star
25

covfefe-coverage

Node API for DevTools JS Coverage data
JavaScript
66
star
26

mojibar-web

JavaScript
63
star
27

chrome-side-tabs-extension

Restored source of Adrian Lungu's awesome Chrome Side Tabs extension
JavaScript
57
star
28

html5readiness.com

visualization of html5 and css3 features and when they are implemented
HTML
57
star
29

font-face-detect

Detect if @font-face support is present in the browser.
JavaScript
54
star
30

commitlintbot

JavaScript
53
star
31

third-party-decode

Decode URLs into 3rd party companies & products.
JavaScript
52
star
32

caltrainschedule.io

πŸš„ caltrain schedules - offline first 🐬
HTML
51
star
33

39ridiculousboxshadows

39 totally ridiculous box shadows
JavaScript
51
star
34

jQuery-miniplugins

assorted snippets and plugins
JavaScript
51
star
35

google-hangouts-grid-view

chrome extension to get a basic grid view in Google Hangouts
JavaScript
46
star
36

request-capture-har

Wrapper for request module that saves all traffic as a HAR file.
JavaScript
40
star
37

mothereffingtextshadow

CUZ WE NEED SOME MOTHER EFFING TEXT SHADOW
JavaScript
37
star
38

statikk

A simple and secure server for static files.
JavaScript
36
star
39

viewport-width-visualization

what do the widths and devices of responsive design look like?
JavaScript
21
star
40

c-cli

Give your `cat` command some color
JavaScript
19
star
41

jQuery-plus

A collection of addons/plugins for jQuery - mostly overloaded jQuery methods...
JavaScript
19
star
42

pidgey-grinding

pokemon go max XP calculator thang thang
HTML
18
star
43

mothereffinghsl

we 'bout to get HSLazy up in this!!
JavaScript
15
star
44

demo

i have a /demo/ URL on my domain. this is it.
JavaScript
13
star
45

gmail-popup-extension

opens gmail in a popup window. Nice if you open a lot of new tabs from it. chrome extension. it's dirty.
JavaScript
13
star
46

email2feed

a google app engine service that takes email at [email protected] and serves a feed at domain.com/foobar
Python
12
star
47

tiny-demos-on-https

can't do a jsbin on HTTPS but sometimes you need it. gh-pages to the rescue.
HTML
12
star
48

Chrome-LikeBlock

A Chrome extension (and greasemonkey script) to block the Facebook Like buttons
JavaScript
11
star
49

fusejs

Alpha version of FuseJS
JavaScript
10
star
50

lite-googlemaps-embed

HTML
9
star
51

npm-publish-devtools-frontend

Shell
9
star
52

timeline-totals

summarize cost of all operations recorded by the devtools timeline
JavaScript
8
star
53

source-map-js

fork of 7rulnik/source-map-js (which is ultimately a fork of mozilla/[email protected] (pre-wasm))
JavaScript
7
star
54

Gmail-mailing-list-permalink-chromeext

Get a permalink of the mailing list message you're looking at in gmail
JavaScript
7
star
55

gf3hairday

ITS FUCKING GLAMOUROUS FEBRUARY 3rd!
7
star
56

CopyLink-extension

Copy link to current page into the clipboard
JavaScript
7
star
57

mydevice

what are my device specs ?
HTML
6
star
58

package-underscore

JavaScript
6
star
59

server-trace-injector-extension

JavaScript
6
star
60

trace-stuff

JavaScript
6
star
61

package-backbone

JavaScript
5
star
62

netlogbytes

JavaScript
4
star
63

lh-build-tracker

build size history for Lighthouse
JavaScript
3
star
64

bot-t-factoids

factoids from temp01's bot-t. RIP bot-t. <3
3
star
65

badge-gdrive-favicons-extension

JavaScript
2
star
66

dadi

Automatically exported from code.google.com/p/dadi
Python
2
star
67

node-imageview

preview images in a browser and set their data uri in an input field
JavaScript
2
star
68

sourcesnapper

exploring an idea
JavaScript
2
star
69

aoe-tech-tree-widget

JavaScript
1
star
70

chromedot

Some notes on chrome subsystems
Makefile
1
star
71

filesystem-api-explorer

Filesystem API explorer - chrome extension
JavaScript
1
star
72

cri-request-interception

JavaScript
1
star