Skip to main content

Command Palette

Search for a command to run...

gremote: Open any Git Remote from the Terminal

Updated
2 min readView as Markdown
A
Always learning; often coding. Powered by caffeine.

As developers, let's be honest, we're rather lazy. We like to be productive, but we like to get things done in the simplest way possible so that we can leave work (somewhat...) on time and be content with our progress. We like things to go fast and be as low friction as possible.


Frameworks, libraries, templates, pre-rolled tools, and automation. These are just some of the way in which we dutifully abide by one of our core mantras - "Keep it Simple, Stupid!". In the same respect, the amount of time we waste time is a major factor in lost concentration and productivity. Come and see what I've done to regain those precious seconds.

Reaching from the keyboard to the mouse, opening a browser and navigating to Github, Gitlab, or BitBucket depending on where the project is, then navigating to the repository you need - it's just too much effort, wouldn't you agree? What do you mean "no..."?!

Okay, so it's not that difficult. And yes, you could just Alt-Tab. But as I said, we're lazy. We like little tools to help make our jobs, and lives, easier. Well, today is no exception, and neither am I!

“When a fire breaks out, first evaluate whether you can be bothered…”

Now that I've finished my internship and I await my return to University (more on this coming soon!), I have a considerable deal of free time. I can't stand the thought of not coding until then, so I've begun working on my portfolio again (woo!). One thing I found with all the constant flicking between numerous repositories as I work on pet projects is just how laborious and click-filled it is. Not to mention I have to remember or check which project is on which service!

So, I wrote gremote. A handy bash script that will grab the remote URL from the current local git repository, and open it in your browser.

gremote @ Github

"Okay, that's handy. But I like to clone with SSH, not HTTPS. What about me?", I hear you cry. Well, cry no more. The clever bit is that gremote has grown up learning how to dissect SSH remote URLs and make an HTTPS URL out of them all by itself! Nifty, eh?

So there you have it. A handy Linux and Mac tool to save you a few clicks, and a few seconds. Not life-changing, but it was good fun and is going to come in rather useful over the years.

More from this blog

C

cognophile

25 posts

Software Engineer