Benedikt Ritter
← Reproducible Thoughts

gh-get: Better Fork Workflow and Cleaner Output

2 min read

I’ve been iterating on gh-get and just pushed a batch of improvements. gh-get is a GitHub CLI extension that clones repositories into a structured folder layout under ~/github/<owner>/<repo>, similar to ghq.

Here is what is new.

A Better Fork Workflow

The --fork flag landed in v2.2.0. Two things about it bothered me since.

The first was the remote setup. When you fork a repository you want to contribute to, the convention is: origin points to your fork, upstream points to the original. gh-get was cloning your fork under your username instead of the canonical location, which meant you had to wire up the remotes yourself.

That’s fixed. gh-get now clones the original repository into ~/github/<owner>/<repo>, renames origin to upstream, and adds your fork as origin. After:

gh get --fork britter/gh-get

You get a clone at ~/github/britter/gh-get already set up for the standard fork-and-PR workflow.

The second thing was the prompt default. When you try to clone a repository you don’t have write access to, gh-get asks whether you want to fork it. That prompt used to default to N. If you’re running gh get on a repository you can’t push to, the answer is almost always yes — so the default is now Y.

Cleaner Output

Before this update, git transfer progress streamed to the terminal during every clone. Useful for large repositories, but noisy for everything else. Transfer progress is now hidden by default, and the in-progress indicator is a single line:

Cloning... done

The destination path is always printed to stdout when the clone finishes:

/home/you/github/britter/gh-get

That makes it easy to pipe into other commands:

cd $(gh get britter/gh-get)

Verbose Mode

If you want the details — repository metadata, fork decisions, remote setup steps, git transfer progress — pass --verbose:

gh get --verbose britter/gh-get

Everything that used to print by default is still there, just opt-in.

Upgrade

If you already have gh-get installed, run:

gh extension upgrade get

The latest release is v2.5.0. The full list of changes is in the changelog.

Share:
Benedikt Ritter

Benedikt Ritter

Gradle & NixOS Consultant

Developer productivity consultant with five years at Gradle Inc. building Develocity, and co-founder of TestLens. Apache Software Foundation member and founder of GradleX. I help engineering teams ship faster through better Gradle build tooling and reproducible NixOS infrastructure.