Today, I want to present a frequently used command line tool of mine: git home
.
It makes working with repositories on web-based hosters faster, so I thought I would share this delightful everyday helper with the world.
What does it do? When called, git home
simply opens the homepage of the repository your are currently in.
It does so by taking the origin
url and opening that in your default web browser using macOS’s open
command. You can optionally specify the name of the remote, if you want to go somewhere else. There are straight-forward alternatives for opening the url on other systems.
Here is the source:
|
|
Create a file called git-home
anywhere in your $PATH
. Afterwards, you can call it using git home
.
According to git history, git-home
made it into my dotfiles repository as git-hub
more than eight years ago. I wrote it to quickly open the repository on the web for looking at issues, pipeline statuses, and similar tasks. Apart from minor improvements, the script has stayed the same since its inception, and has proven to be a delight in what it does. I hope it will be for you as well.