DEV Community

Jasterix
Jasterix

Posted on

Do you `git open`?

I recently came across a reference to git open, a command that lets you open the GitHub page for your current repo. And with it, the answer to a lifetime's frustration with the multistep process of opening a repo on Chrome (not really).

Ecstatic, I opened my terminal and typed "git open".

git: 'open' is not a git command. See 'git --help'.

The most similar commands are
    clean
    clone
    notes
    prune
Enter fullscreen mode Exit fullscreen mode

Okay...

A quick Google search brought me to this npm package by Paul Irish. Progress!

Following the instructions, I returned to my terminal and typed "npm install --global git-open". Initially, this didn't work for me. But while trying recreate the error to write this article, the command worked perfectly. Go figure.

/usr/local/bin/git-open -> /usr/local/lib/node_modules/git-open/git-open
/usr/local/bin/git-home -> /usr/local/lib/node_modules/git-open/git-open
+ git-open@2.1.0
added 1 package from 3 contributors in 0.443s
Enter fullscreen mode Exit fullscreen mode

But if for some reason this doesn't work for you, continue reading. On a whim, I tried brew install git-open.

To my delight this works. Success!

==> Summary
🍺  /usr/local/Cellar/git-open/1.3: 4 files, 6.3KB, built in 3 seconds
Enter fullscreen mode Exit fullscreen mode

Gif showing git-open in action

Now, if only there were some package I could install to view my terminal output history. Then I wouldn't have had to uninstall and reinstall git-open multiple times just to get the output above

Top comments (9)

Collapse
 
pjam profile image
Pierre Jambet

If you want to enhance the experience on the cli with more GitHub related features, I would also suggest taking a look at hub (hub.github.com/), it does a lot but really the only command I use is hub browse which seems to be equivalent to git open.

That being said, I didn’t know about and it’s really cool that it works with other providers like gitlab!

Collapse
 
artu_hnrq profile image
Arthur Henrique

Nice to know!

Collapse
 
jasterix profile image
Jasterix

Thanks for the heads up

Collapse
 
waylonwalker profile image
Waylon Walker

👏👏 I had no idea this was a git command. This is great!

Collapse
 
jasterix profile image
Jasterix

Changed my life 🙌🏿

Collapse
 
artu_hnrq profile image
Arthur Henrique

Very nice to know

Collapse
 
cguttweb profile image
Chloe

A cool tip

Collapse
 
mstykmshy profile image
Saj King

This is SO useful, I'm definitely sharing with everyone I know.. Thank you for this! :)

Collapse
 
jasterix profile image
Jasterix

Glad you found it helpful :D