Skip to main content

gittwig

A terminal user interface (TUI) for viewing and switching git branches, built with Python and Textual.

I built this because I wanted a quick way to view git branches and switch between them. Vibe-coded with Claude Code.

This provides a fast, easy way to browse branches, see the commit history for a given branch, identify files changed in a branch, and view file diffs with syntax highlighting. As an open source developer who works with many branches across multiple projects, this is very helpful for figuring out where I left off and juggling multiple branches.

Screenshot

Features

  • Browse local and remote branches in a navigable list
  • View changed files compared to your default branch
  • View commit history unique to each branch
  • Syntax-highlighted diff viewer
  • Checkout branches with Enter
  • Create and delete branches
  • Fetch, push, and pull operations
  • Filter branches with / search
  • Vim-style keyboard navigation

Installation

Requires Python 3.12 or later.

Install uv and run:

uv tool install gittwig

To run with uv without installing:

uv tool run --from gittwig twig

Usage

Run twig in any git repository:

twig

Or specify a repository path:

twig /path/to/repo

Keyboard Shortcuts

Navigation

Key Action
j / k Move cursor down / up
h / l Focus left / right pane
g g Go to top of list
G Go to bottom of list
Ctrl+d / Ctrl+u Page down / up
Enter Select item / checkout branch

Branch Operations

Key Action
n Create new branch and switch to it
d Delete branch (with confirmation)
r Refresh data
f Fetch from remotes
p Push current branch
P Pull current branch

Other

Key Action
/ Search/filter branches
? Show help
q Quit
Escape Close modal / cancel

Development

# Install development dependencies
uv sync --group dev

# Run tests
pytest

# Run linter
ruff check .

# Run type checker
mypy src

License

MIT License - see LICENSE for details.

Metadata

Release files for gittwig 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gittwig 0.3.0
File Size Uploaded Provenance
gittwig-0.3.0.tar.gz 15.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gittwig 0.3.0
File Interpreter ABI Platform
gittwig-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.6 kB

Release files / gittwig-0.3.0.tar.gz

Download URL gittwig-0.3.0.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2620895a0a06dd0da029a346f2d794a42ae4217902a74d797d35dadbb127648c
BLAKE2b-256 checksum
How to use checksums
8561641e35e90df9989d0a7b25b008a3ba0239610ac97ce813dc33a9533bc373
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release files / gittwig-0.3.0-py3-none-any.whl

Download URL gittwig-0.3.0-py3-none-any.whl
Size 23.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
089c83543b068292e36f8a11aba94fdc43b7a05173f714c12cd2b2770d7bf8e3
BLAKE2b-256 checksum
How to use checksums
a7cf63bd2a9e62376982cdd7600ad982fabd98963997da589ef318d08e6c2e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Security for gittwig 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page