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.
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.
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 |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gittwig-0.2.0.tar.gz.
File metadata
- Download URL: gittwig-0.2.0.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab898bf4f6975ed7b17d000b27dcf42040417cf982b98ea4df78f848ecdeabb5
|
|
| MD5 |
fc9b1092318228d8f46f97504fa51ca4
|
|
| BLAKE2b-256 |
2e829549c599cd7a7b0014ca6a6cafbcefceebae1a2e5136bf69029b10595289
|
File details
Details for the file gittwig-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gittwig-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3161f4e7a751967022355799d00173313a0ab81cbd1cd7589c67552b7855637
|
|
| MD5 |
c6cd30ebf53c6c56fd9c6d5e82026d1c
|
|
| BLAKE2b-256 |
6362a48e654bf468e550ad87c6e92bf96992903b96083d9e133f0dc34cc83aea
|