Zombie Zen

gg 1.0 released!

By Ross Light
gg

I’m proud to announce the first stable release of gg, my alternative Git command-line interface! This has been a release over two years in the making: I’ve battle-tested gg across many different workflows and projects. It’s saved me tons of time every day, and I hope it can save time for others too. Download the latest release and try it out for yourself!

gg is a tool I built to ease my day-to-day version control experience. In particular, I wanted to restore my productivity to the level I had when using Mercurial: easy-to-remember commands with reasonable defaults.

For example, a frequent task is updating your local copy with the latest upstream changes. In Mercurial, this was as straightforward as:

hg pull -u

In Git, there’s much more typing.

git stash
git pull --ff-only
git stash pop
# resolve conflicts if you need to
git stash drop  # if there were conflicts

In gg, this same operation is:

gg pull -u

Along with a more focused set of commands, gg provides:

  • Abbreviations. git commit -a takes 13 characters to type. gg ci takes 5 to do the same thing (don’t worry, you can still type gg commit).
  • Built for GitHub and Gerrit. gg has built-in support for creating pull requests and creating Gerrit changesets straight from the command-line. No more context switching.
  • Safer rebases. gg rebase automatically detects common mistakes while rebasing and infers the correct change.
  • Local branches match remote branches. Using gg pull automatically creates branches that match your remotes to avoid confusion.
  • Optional staging. gg avoids using the staging area to save on typing and mistakes. However, gg takes great care to avoid perturbing the staging area, so for more advanced commits, you can keep using the same Git commands you’re used to.
  • Works with existing Git tools. You can use or not use gg as much as you want in your workflow. gg is just a wrapper for the Git CLI, so it works with any hooks or custom patches to Git that your project may use. You can see the exact Git commands gg runs by passing in --show-git.

Now you may ask, why does this need a whole new program to solve? I started gg as a set of Git shell aliases, but soon I realized that what I wanted had a much larger scope. To provide high-level assurances for trickier operations like gg update or gg rebase, gg needs to parse Git output to understand user intent and check for edge conditions. This simply would have been too difficult or hard-to-package as a collection of shell scripts.

Try out gg today by downloading the latest release. And if you have any questions or feedback, open an issue on GitHub. Thanks!

_Conversations on Twitter, Reddit, and LinkedIn._