opensourceprojects.dev

A broadsheet for software that doesn't ask for your email

Git Town: Git commands that automate branch workflows without the ceremony
GitHub RepoImpressions4

Project Description

View on GitHub

Git Town: Git Workflow Automation Without the Ceremony

If you’ve ever managed a Git branch-heavy workflow (think feature branches, hotfixes, releases), you know the drill: git checkout main, git pull, git checkout -b feature/xyz, git push, open PR, merge, delete branch locally and remotely, rinse, repeat. It’s not hard, but it’s tiring. One small mistake — like forgetting to sync before branching — and you’re dealing with conflicts that didn’t need to exist.

Enter Git Town. It’s a set of Git commands that wraps common branch workflows into single, sane commands. No heavy ceremony, no new DSL. Just git commands that feel like they should have been there from day one.

What It Does

Git Town adds custom Git subcommands (like git hack, git ship, git sync) that automate the mechanics of branch management. Think of it as a power user’s shortcut for teams that use a branching strategy (Git Flow, GitHub Flow, trunk-based, or your own hybrid).

At its core, it handles:

  • Creating new feature branches from an updated main branch
  • Syncing your current branch with its parent (rebase or merge)
  • “Shipping” a branch back to main, merging it cleanly, and cleaning up both local and remote branches
  • Managing stacked branches (branches on top of branches) without losing your mind

It does this by reading your Git history and conventions (like branch hierarchy or parent relationships), then executing the right sequence of low-level Git commands. You don’t need to configure a lot — it tries to infer what makes sense.

Why It’s Cool

  • It’s just Git under the hood. Git Town doesn’t replace Git or add a daemon. It generates standard Git commands. You can inspect the exact steps with --dry-run. That’s reassuring.
  • No lock-in. If you stop using it, your repo is untouched. It only creates branches, commits, and merges like you would manually.
  • Opinionated but configurable. You choose sync strategy (rebase or merge), branch lineage, and hook into your existing workflow — not the other way around.
  • Great for stacked PRs. If you work with multiple dependent branches (e.g., feature/cache on top of feature/auth), git sync intelligently rebases the whole stack. This alone saves a ton of manual conflict resolution.
  • Cross-platform and written in Go. Single binary, no dependencies. Works on Linux, macOS, Windows. Fast.

How to Try It

Install it in a few seconds:

# macOS
brew install git-town

# Linux or Windows (using Go)
go install github.com/git-town/git-town@latest

# Or download from releases page

Then in any Git repo, run:

git town config setup

It walks you through a simple wizard: your main branch name, sync strategy, and optional features like git push behavior. That’s it.

Try a quick demo:

git hack new-feature   # creates branch from up-to-date main
# ... make some commits ...
git sync                # updates your branch with latest main
git ship                # merges to main and deletes the branch

Every command supports --dry-run to see exactly what Git commands it will run.

Final Thoughts

Git Town isn’t trying to be the next Git Flow or some complex orchestration tool. It’s a lightweight automation layer for the tedious parts of branch-based development. If you’ve ever had to rebase a stack of five branches and then fix conflicts in the wrong order, you’ll appreciate it immediately.

It’s not for everyone — if you barely use branches or work alone on a single branch, you don’t need it. But if your team lives in branches, pulls before every new branch, and clean up after merges, Git Town is one of those tools that quietly saves 10–15 minutes a day without making you change how you think about Git.

Give it a shot on a side project first. Worst case, you delete the binary and nothing changes. Best case, you wonder how you lived without git hack.


Brought to you by @githubprojects

Back to Projects
Project ID: 7a39ac7a-2271-4bd7-ba9f-bd9db529fc1cLast updated: July 1, 2026 at 09:46 AM