šæ Gitwig ā A Minimal Terminal Git UI
Gitwig (from Git + Twig, representing the branches of a repository) is a lightweight terminal-based Git UI, designed as a fast and minimal alternative to GUI tools like SourceTree. Built with Rust and ratatui, Gitwig presents your Git-related items in a clean, bordered layout directly in the terminal.
šø Preview
(Coming soon ā or add an asciinema/screenshot here!)
⨠Features
- Fullscreen terminal UI using
ratatuiandcrossterm - Config-driven layout using
config.toml - Add / edit / delete items directly from the UI ā changes persist back to the config file
- Per-item status indicators ā see at a glance whether each item is a git repo, a plain directory, or missing
- Press
Enteron any item to open a full-screen Detail view with branch, HEAD commit, remotes, and working-tree status (for git repos) or a clear "plain directory" / "missing" report otherwise - Bordered items displayed inside a main border
- Mode-aware status bar that always shows the relevant shortcuts
āØļø Keybindings
| Key | Mode | Action |
|---|---|---|
ā / k |
Normal | Move selection up |
ā / j |
Normal | Move selection down |
a |
Normal | Add a new item (via interactive fzf search) |
e |
Normal | Edit the selected item |
d |
Normal | Delete the selected item (asks) |
R |
Normal | Refresh status of selected item |
f |
Normal | Enter repository search mode |
p |
Normal | Toggle pin status of selected item |
o |
Normal | Cycle list sorting mode (Custom ā Alphabetical ā Recent ā Changes) |
O |
Normal | Toggle list sorting direction (ascending vs. reversed) |
g |
Normal | Launch the preferred Git client for selected repository (configurable in settings, default is gitui) |
s |
Normal | Open options/settings page |
Enter |
Normal / Commits list | Open Detail view for selected item / Inspect selected commit |
? |
Normal / Help | Toggle the shortcut overlay |
ā / q |
Normal | Quit |
Esc |
Normal | Clear active repository search filter |
Enter |
Editing | Save the typed text and persist |
Esc |
Editing | Cancel without saving |
Enter |
RepoSearchInput | Apply repository search and return to Normal mode |
Esc |
RepoSearchInput | Clear repository search and return to Normal mode |
Enter |
Settings (Edit) | Save settings edit |
Esc |
Settings (Edit) | Cancel settings edit |
Esc / q |
Settings | Exit Settings and return to Home |
ā / ā / k / j |
Settings | Navigate setting fields |
Enter / Space |
Settings | Toggle / Edit selected setting |
Backspace |
Editing | Erase one character |
y / Y |
Confirm Dialog | Confirm action (delete item/branch/tag, push branch/tag/all tags, abort/continue merge) |
n / N / Esc |
Confirm Dialog | Cancel action |
? / Esc / q |
Help | Close the help overlay |
Esc / q |
Detail | Return to the list |
Tab / Shift+Tab |
Detail | Cycle active detail view tabs (Workspace ā Files ā Graph ā Branches ā Tags ā Remotes ā Stashes ā Overview) |
w / W |
Detail | Cycle panel focus forward (w) / backward (W) |
1 - 8 |
Detail | Jump directly to tab: Workspace (1), Files (2), Graph (3), Branches (4), Tags (5), Remotes (6), Stashes (7), or Overview (8) |
ā / k |
Detail | Move selection or scroll list/diff/tree up |
ā / j |
Detail | Move selection or scroll list/diff/tree down |
PgUp / PgDn |
Detail / Normal / Settings | Scroll list/diff/tree/settings by configured page_size |
Home / End |
Detail / Normal / Settings | Jump to top / bottom of list/diff/tree/settings |
Enter |
Detail | Stage/Unstage file (Workspace tab), checkout branch (Branches tab), checkout tag (Tags tab), or Inspect commit |
f / F |
Detail | Fetch remote repository (Branches / Tags / Remotes tabs) |
p |
Detail | Pull selected local branch from remote (Branches tab) or Push selected tag (Tags tab; asks confirmation) |
Shift+P |
Detail | Push selected local branch to remote (Branches tab) or Push all tags (Tags tab; asks confirmation) |
ā / ā |
Detail | Focus Local/Remote branch (Branches tab) or Local/Remote tag (Tags tab) |
ā / ā or < / > or , / . |
Detail | Collapse/Expand directory (Files tab) |
f |
Detail | Fuzzy find files (Files tab) |
c |
Detail | Open commit prompt (Workspace tab or Inspect view), or Create branch from HEAD (Branches tab) |
a |
Detail | Stage All (Workspace tab Unstaged focus) / Unstage All (Workspace tab Staged focus) or Apply stash (Stashes tab) |
x |
Detail | Discard selected file changes (Workspace tab or Inspect view; asks confirmation) |
X |
Detail | Discard all changes in repository (Workspace tab or Inspect view; asks confirmation) |
i |
Detail | Interactive rebase from selected commit (Workspace tab commits list) |
d |
Detail | Delete selected branch (Branches tab; asks confirmation), tag (Tags tab; asks confirmation), or stash (Stashes tab; asks confirmation) |
s |
Detail | Open Stashing UI overlay (Workspace tab) or Prompt to save stash (Stashing UI / Stashes tab) |
u |
Detail | Toggle "Stash untracked files" option (Stashing UI) |
i |
Detail | Toggle "Keep index" option (Stashing UI) |
Ctrl+U |
Input (Stash) | Toggle "Stash untracked files" option (Stash Create popup) |
Ctrl+I |
Input (Stash) | Toggle "Keep index" option (Stash Create popup) |
m |
Detail | Merge selected branch into current branch (Branches tab; asks confirmation) |
r |
Detail | Rebase current branch onto selected branch (Branches tab; asks confirmation) |
o |
Detail | Accept OURS version of conflict (Workspace tab Conflicts / ConflictDiff) |
t |
Detail | Accept THEIRS version of conflict (Workspace tab Conflicts / ConflictDiff) |
r |
Detail | Mark conflict as resolved (Workspace tab Conflicts / ConflictDiff) |
A |
Detail | Abort the merge (Workspace tab Conflicts / ConflictDiff; asks confirmation) |
C |
Detail | Continue the merge (Workspace tab Conflicts / ConflictDiff; asks confirmation) |
f |
Detail | Open search column picker and go to logs (Workspace tab) |
R |
Detail | Resync the active tab state |
? |
Detail | Toggle detail help overlay |
Esc / q / ? |
DetailHelp | Close detail help overlay |
āC |
CommitInput (Edit) | Finish editing commit message (switches to confirm state) |
āµ (Enter) |
CommitInput (Edit) | Insert a newline |
Backspace |
CommitInput (Edit) | Erase one character from commit message |
Esc |
CommitInput | Cancel commit and return to Detail view |
āµ (Enter) |
CommitInput (Confirm) | Submit / execute Git commit |
e / E |
CommitInput (Confirm) | Edit / resume typing commit message |
a / A / Space |
CommitInput (Confirm) | Toggle amend last commit option |
Left-Click (Mouse) |
Normal | Select the clicked item |
Double-Click (Mouse) |
Normal | Open Detail view for clicked item |
Left-Click (Mouse) |
Detail | Shift focus to the clicked panel or change active tab |
Left-Click + Drag (Mouse) |
Detail | Drag panel boundary splitters to dynamically resize layout splits |
Scroll Wheel (Mouse) |
Normal / Detail | Scroll selected list, graph view, branches, tree items, or unified diffs |
Press ? at any time in normal mode to see the full keybinding reference as a centered popup. The help overlay only handles the dismissal keys ā your selection and scroll position are preserved underneath.
The selected card's border color mirrors the current operation mode:
- Default (Muted) ā browsing the list (unselected).
- Cyan ā browsing the list (selected).
- Yellow ā typing into the input field during add/edit; the selected card's border turns yellow so you can see exactly which item will be replaced.
- Red ā awaiting delete confirmation; the doomed card's border turns red.
The selected item is marked with a left-edge ā accent, a colored border, and bold text. In ADDING and EDITING modes the real terminal cursor sits at the end of your input so you can see exactly where the next character will land.
š Item status indicators
Each card shows a colored symbol on the right reflecting the item's filesystem state:
ā gitā the item is a directory containing a.gitentry (a git repository, worktree, or submodule).ā dirā the item is a directory, but not a git repository.ā missingā the item is not a directory on this machine (doesn't exist, is a file, or isn't accessible).
For git repositories the indicator also shows compact counts for any non-zero values:
| Suffix | Meaning | Colour |
|---|---|---|
N+ |
N files staged for commit | Cyan |
N! |
N files modified but not staged | Yellow |
N? |
N untracked files | Muted |
Nā |
N commits ahead of upstream (needs push) | Bold |
Nā |
N commits behind upstream (needs pull/fetch) | Yellow |
When all counts are zero the indicator shows ā clean. When the branch has no configured upstream, only the worktree counts appear (no ā/ā). Press ? at any time to see the legend inside the app.
Items support ~ and ~/... expansion, so ~/code/gitwig resolves to your home directory. Statuses are recomputed only when you add, edit, or delete an item ā they are not polled in the background. Press r to manually refresh the selected item's status if you've changed the filesystem outside the app (e.g. git init in a directory that was previously ā dir); the status bar briefly flashes Refreshed so you know the check ran.
š Detail view
Press Enter on a selected item to open a full-screen Detail view. The detail view supports eight tabs for git repositories: Details, Files, Graph, Branches, Tags, Remotes, Stashes, and Overview.
- Press
1to switch to the Details tab. - Press
2to switch to the Files tab. - Press
3to switch to the Graph tab. - Press
4to switch to the Branches tab. - Press
5to switch to the Tags tab. - Press
6to switch to the Remotes tab. - Press
7to switch to the Stashes tab. - Press
8to switch to the Overview tab. - Alternatively, press
Tab/Shift+Tabto cycle forward/backward through the tabs. - You can also click on the tab headers directly with the mouse to switch tabs.
Press
Escorqto return to the repository list.
Panel Layout & Navigation (Workspace Tab)
For a git repository, the Workspace tab is split into multiple rounded panels with a 40:60 width ratio on the bottom:
- Commits (top 50%): Lists the recent commits in the repository. If there are uncommitted changes, a special row named
Uncommitted changeswill be pinned to the very top. - Staging Area / Changed Files (bottom-left 40%): Lists files that are modified, staged, or untracked. When
Uncommitted changesis selected at the top, this panel is split vertically intoStagedandUnstagedsections. When a real commit is selected, it is split horizontally, showing the list of files modified in that commit in the top half, and full commit details (hash, author, date, refs, and message) in the bottom half. - Staging Details (bottom-right 60%): Displays the unified diff of the selected file.
Files Tab
The Files tab displays all tracked files in the repository as an interactive directory tree on the left, and a preview panel on the right.
- Directory nodes are prefixed with
>when collapsed andā¼when expanded. - File nodes are prefixed with
š. - Expand Folder: Select a collapsed directory and press
>or.orRight-Arrow. - Collapse Folder: Select an expanded directory and press
<or,orLeft-Arrow. - Preview Panel: Selecting a file displays its content (up to 100 KB) on the right; selecting a directory displays a list of files and folders directly inside it.
Graph Tab
The Graph tab renders the git log history graph / branch visualization graph.
Branches Tab
The Branches tab is split vertically into left and right panels:
- Local Branches (left): Lists local branches in the repository, sorting the active branch to the top marked with
ī. - Remote Branches (right): Lists remote tracking branches.
You can focus either branch panel by pressing w / W or using the ā / ā arrow keys.
Tags Tab
The Tags tab lists both local tags and remote tags.
- Select a local tag and press
āµ(Enter) to checkout that tag. - Select any tag and press
d/Dto delete it (asks for confirmation). - Press
pto push the selected tag to the remote (asks for confirmation). - Press
P(Shift+P) to push all tags to the remote (asks for confirmation).
Remotes Tab
The Remotes tab lists configured remotes for the repository.
Stashes Tab
The Stashes tab lists all available stashes in the repository with a horizontally split layout:
- Stashes (Top-Left): Lists all stashes. Selecting a stash automatically highlights the first file in the files list. Press
d/Dto delete the selected stash, ora/Ato apply it (both options ask for confirmation). When applying, you can toggle whether to delete the stash after applying (default is Yes). - Stashed Files (Bottom-Left): Lists the files changed/saved in the selected stash.
- Stash Diff (Right): Shows the unified patch diff of the selected file.
- Navigate stashes or stashed files using
ā/kandā/j.
Stashing UI
Pressing s / S inside the Workspace tab opens the dedicated Stashing UI overlay popup:
- Left Panel: Displays the list of all modified, staged, unstaged, untracked, and conflicted files that will be stashed. You can navigate through this list using
ā/ā/k/j. - Right Panel: Displays checkboxes for stashing options:
- Toggle stashing untracked files with
u. - Toggle keeping the index with
i.
- Toggle stashing untracked files with
- Actions:
- Press
sto save the stash. This opens a text prompt to input an optional stash message/name (where stashing options can also be toggled withCtrl+UandCtrl+I). - Press
Esc/q/Qto cancel and return to the Workspace view.
- Press
Overview Tab
The Overview tab displays key repository details including resolved paths, branch upstream tracking info, configured remotes, and general status counts.
Navigation & Interaction
You can navigate and interact with these panels in the following ways:
- Cycle Focus: In the Details, Files, Branches, Tags, and Stashes tabs, press
w/Wto cycle panel focus:- Workspace tab:
CommitsāStagedāUnstagedāStagingDetails. - Files tab:
Files(left tree list) āFileContent(right preview panel). - Branches tab:
Local BranchesāRemote Branches. - Tags tab:
Local TagsāRemote Tags. - Stashes tab:
StashesāStashed FilesāStagingDetails. Focus defaults to the main panel of the tab when switching tabs (e.g.,Commitson Workspace tab,Fileson Files tab,Local Brancheson Branches tab,Local Tagson Tags tab,Stasheson Stashes tab).
- Workspace tab:
- Mouse Click to Focus/Select: Left-click inside any panel's boundaries (including branch/tag/stash list panels, stashed files list, files list, and the files tab content preview panel) to focus it immediately.
- Resize Split Panels: Left-click and drag the vertical or horizontal boundary splitter lines between panels to resize them dynamically. This is supported in:
- Workspace / Inspect: Main vertical split (commits vs details), bottom horizontal split (left list vs right diff), and left vertical split (staged vs unstaged or commit details vs files list).
- Files: Horizontal split (repository files tree vs file content preview).
- Branches: Horizontal split (local branches vs remote branches).
- Stashes: Horizontal split (stash lists vs diff) and left vertical split (stashes list vs stashed files).
- Overview: Horizontal split (overview info vs committer stats).
- Mouse Wheel Scroll: Use the mouse wheel to scroll vertically through the active list, commit history, branch list, files list, stashed files list, staging details diff, or files tab preview panel.
- Navigate Lists: Use
ā/kandā/jto select a commit, file, branch, tag, stash, stashed file, or file tree item in the active list. - Scroll Diff: When the
Staging Detailspanel is focused, you can scroll the unified diff text vertically usingā/kandā/j(line-by-line) orPgUp/PgDn(page-by-page). - Scroll File Content: When the files tab
FileContentpreview panel is focused, you can scroll the preview text vertically usingā/kandā/j(line-by-line) orPgUp/PgDn(page-by-page). - Stage/Unstage Files: Select the
Uncommitted changesrow at the top, select a file in either theStagedorUnstagedlist, and pressEnterto stage or unstage that file instantly. Pressato Stage All (when focused on Unstaged) or Unstage All (when focused on Staged), which automatically shifts panel focus to the opposite list. Pressxto discard changes in the selected file, orXto discard all changes in the repository (both ask for confirmation before performing). - Network Progress Bar: Any long-running network operations (such as Fetch, Pull, or Push) will display a centering animated progress bar popup so the UI thread remains responsive and visual feedback is clear. If an operation hangs or takes too long, you can press
Escto force-dismiss the progress popup and resume TUI interaction immediately. - Multi-Remote Selection Picker: For write operations (pushing branch/tags, deleting tags, fetching tags), if the repository has multiple configured remotes and no upstream tracking branch is set, a selection picker popup will appear allowing you to select which remote to target using āā and Enter.
- Manage Branches: While on the Branches tab:
- Select any local branch (other than the currently active one) and press
Enterto check it out (safe checkout strategy applies). - Press
f/Fto fetch updates from the remote in the background. - Select any local branch and press
pto pull updates from its remote in the background (can only pull into the currently checked-out branch). - Select any local branch and press
Shift+Pto push it to the remote in the background (if no upstream is configured, it will attempt to push to the first configured remote and set it as the upstream tracking branch). - Select any remote branch and press
Enterto check it out (this will switch to the branch, creating a local tracking branch if it doesn't already exist). - Press
c/Cto create a new branch from the currently checked out branch (or HEAD). A popup dialog will prompt for the new branch name. - Select any local or remote-tracking branch and press
d/Dto delete it. A confirmation dialog will prompt before performing the deletion. (The currently checked out branch cannot be deleted).
- Select any local branch (other than the currently active one) and press
- Commit Staged Changes / Amend Last Commit: Press
cfrom the Workspace tab or from the Inspect view to open a centered Commit popup window (active if there are staged changes OR a prior HEAD commit exists to amend).- Compose Mode: Type your commit message. Press
Ctrl+Cto lock in the text and switch to confirmation state, pressEnterto insert a newline, orEscto cancel. - Confirm Mode: Press
Enterto execute the commit,eto return to composing/editing the message,a/A/Spaceto toggle the "Amend last commit" option, orEsc/qto close the popup. Toggling amend to active when the buffer is empty automatically populates the text box with the message from the last commit.
- Compose Mode: Type your commit message. Press
For a plain directory the view confirms the resolved path and explains that no .git entry was found.
For a missing item the view confirms the resolved path and notes that the path does not exist or isn't accessible.
The detail snapshot is taken once when you press Enter ā it is not refreshed while open (except for staging/unstaging actions which refresh dynamically). Close and re-open to re-read the repository state.
After every successful add / edit / delete, the status bar briefly shows Saved or Deleted. If the write fails, the status bar shows Save failed: <reason> instead ā your in-memory list still reflects the change, but the file on disk does not.
š Main Page Sorting
The main page repository list can be sorted dynamically using shortcuts:
- Cycle Sort Order (
o): Cycles through the sorting modes:Custom(preserves your manual list order),Alphabetical,Recent Visit(tracks when you enter a repository's detail view), andLatest Changes(based on HEAD commit timestamps or folder modification times). - Toggle Sort Direction (
O): Toggles ascending vs. descending/reversed sort direction. The top border displays the active sort mode (e.g.Sort: Alphabetical (Rev)).
š§ Configuration
Gitwig stores its config in ~/.gitwig/config.toml. The directory is created automatically on first launch.
First-run migration
If ~/.gitwig/config.toml doesn't exist yet, Gitwig looks for an existing config to migrate from:
- A path passed as the first CLI argument (
gitwig path/to/config.toml). ./config/config.tomlrelative to the current working directory../config/config.tomlrelative to the executable.~/.config/gitwig/config.toml(new XDG location),~/.config/twig/config.toml(legacy Twig XDG location), or~/.twig/config.toml(legacy Twig home location).- Nothing found ā a default config is written to
~/.gitwig/config.toml.
After the first run the migrated (or generated) file becomes the sole source of truth; the original is left untouched.
Example: config.toml
= ["Repo A", "Repo B", "Side Project", "Test Repo"]
# Event-loop poll interval in milliseconds (default: 100).
# Lower ā more responsive input, higher ā less CPU usage. Sane range: 16ā500.
= 100
# Sorting preferences for the main page list
= "custom"
= false
# Enable compatibility mode to use simple ASCII symbols
= false
Config keys
| Key | Type | Default | Description |
|---|---|---|---|
items |
[String] |
[] |
Paths shown in the main list. Managed by the in-app a (fzf search) / e / d shortcuts. |
poll_interval_ms |
Integer |
100 |
How long (ms) the event loop waits between input checks. Lower feels snappier; higher saves CPU. |
max_commits |
Integer |
0 |
Maximum commits to load in workspace view. Set to 0 for unlimited. |
page_size |
Integer |
10 |
Number of lines/items scrolled by Page Up / Page Down. |
sort_by |
String |
"custom" |
Main list sorting preference ("custom", "alphabetical", "recent_visit", "latest_changes"). Managed by o. |
sort_reverse |
Boolean |
false |
Inverts the main list sorting direction (ascending vs. descending). Managed by O. |
theme |
String |
"default" |
Active theme configuration name. Managed in Settings s. |
compatibility_mode |
Boolean |
false |
Enable to use simple ASCII symbols instead of rich Unicode icons/emojis (prevents layout alignment issues in restricted terminals like RustRover's built-in terminal). |
fzf.max_depth |
Integer |
3 |
Maximum directory depth to search for git repositories during discovery. |
fzf.start_dir |
String |
"$HOME" |
Starting directory for interactive repository discovery via FZF. |
fzf.excludes |
[String] |
[".git", "node_modules", "target"] |
Directory names excluded from FZF discovery. |
Gitwig writes back to whichever file it loaded from, so edits made in the UI persist across runs.
šØ Font & Symbol Support
Gitwig uses rich Unicode symbols, icons, and Nerd Font glyphs (such as ā, ā, ā, ā¶, ī , etc.) to provide a premium, modern visual experience directly in the terminal.
To display these symbols correctly without layout breakage or replacement characters (e.g., question marks or empty blocks), your terminal emulator must use a font containing Nerd Font glyphs.
Recommended Font (Bundled)
We have bundled the clean and highly popular JetBrains Mono Nerd Font inside this repository:
- Location:
resources/fonts/JetBrainsMonoNerdFontMono-Regular.ttf
š„ How to Install the Font:
- macOS: Open the
resources/fonts/directory in Finder, double-clickJetBrainsMonoNerdFontMono-Regular.ttf, and click Install Font. - Windows: Right-click
JetBrainsMonoNerdFontMono-Regular.ttfand select Install (or Install for all users). - Linux: Copy the font file to your local font directory:
āļø How to Configure Your Terminal:
Open your terminal emulator settings (e.g. iTerm2, Alacritty, Kitty, Windows Terminal, macOS Terminal) and set the active font to JetBrainsMono Nerd Font Mono (or JetBrainsMonoNF).
š ļø Compatibility Mode (No Font Install Required)
If you prefer not to install custom fonts, Gitwig includes a built-in fallback:
- Open the settings popup in the app by pressing
s. - Focus the
Compatibility Modeoption and toggle it totrue. - Alternatively, add
compatibility_mode = truein yourconfig.toml.
When Compatibility Mode is active, Gitwig will automatically substitute all Nerd Font glyphs and complex emojis with standard ASCII and basic terminal symbols to ensure a clean, stable layout in any standard monospaced font.
š Installation & Running
Installation
You can install Gitwig directly from crates.io:
Building from Source
Alternatively, you can clone the repository and build it from source:
The compiled binary will be located at target/release/gitwig. You can copy it to a directory in your $PATH or run it directly.
Running
# Run with default config resolution
# Run with an explicit config path