Skip to main content

A terminal TUI application for managing Git branches

Project description

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.

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.

# Clone the repository
git clone https://github.com/RhetTbull/gittwig.git
cd gittwig

# Install with uv (recommended)
uv sync

# Or install with pip
pip install -e .

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
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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gittwig-0.1.0.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gittwig-0.1.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file gittwig-0.1.0.tar.gz.

File metadata

  • Download URL: gittwig-0.1.0.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for gittwig-0.1.0.tar.gz
Algorithm Hash digest
SHA256 72e5134f5b065041891c169ff01ec45e4bbb43653501942d00130ea6501320a3
MD5 8be78bafcd334b795708d33e68387563
BLAKE2b-256 42a5ebc42b15b200f13998b6319cad3239f9bf6ac7831329f92ced27aebfc13b

See more details on using hashes here.

File details

Details for the file gittwig-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gittwig-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for gittwig-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0efbafd425115dddbab23c01f6a637350aa21c49ba275e8345fc353cf179984
MD5 88f54e5b064796ee2cf43345ffacad83
BLAKE2b-256 6834246de74130e598cfa6c4c860f91ad8423bce15a67a580b448881ee7bf93d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page