Gilt User Guide
August 16, 2026 · View on GitHub
Gilt - Git Interface for Lisp Terminal
A comprehensive guide to using Gilt, the LazyGit-style Git TUI written in Common Lisp.
Overview
Gilt provides a terminal-based interface for Git, inspired by LazyGit. The interface is divided into panels that let you navigate your repository, stage changes, commit, and perform advanced Git operations.
Screen Layout
┌─────────────────────────────────┬────────────────────────────────────────────┐
│ [1] Status │ [0] Main (Diff/Patch view) │
├─────────────────────────────────┤ │
│ [2] Files │ │
├─────────────────────────────────┤ │
│ [3] Local branches │ │
├─────────────────────────────────┤ │
│ [4] Commits ├────────────────────────────────────────────┤
├─────────────────────────────────┤ Command Log │
│ [5] Stash │ │
└─────────────────────────────────┴────────────────────────────────────────────┘
Help bar with context-sensitive keybindings
Panels
| Panel | Description |
|---|---|
Status [1] | Shows repository name and current branch |
Files [2] | Lists modified, staged, and untracked files |
Branches [3] | Shows local branches (current branch marked with *) |
Commits [4] | Displays commit history with hash, author initials, and message |
Stash [5] | Lists stashed changes |
Main [0] | Shows diff/patch for selected file or commit details |
| Command Log | Displays recent Git commands executed |
Visual Indicators
File Status Colors
| Color | Status | Indicator |
|---|---|---|
| Yellow | Modified | M |
| Green | Added | A |
| Red | Deleted | D |
| Magenta | Untracked | ? |
| Cyan | Renamed | R |
Commit Display
Each commit line shows:
- Yellow - Commit hash (e.g.,
a1b2c3d) - Cyan - Author initials (e.g.,
GTfor Glenn Thompson) - Green - Commit indicator (
●for HEAD,○for other commits) - White - Commit message
Other Indicators
- Panel item counts - Bottom-right corner shows "X of Y" (e.g., "3 of 12")
- Current branch - Highlighted in green with
*prefix - Focused panel - Bright cyan border and bold magenta title
Keybindings
Global Navigation
| Key | Action |
|---|---|
j / ↓ | Move selection down |
k / ↑ | Move selection up |
Tab / l | Switch to next panel |
h | Switch to previous panel |
1-5 | Jump directly to panel by number |
r | Refresh all data |
q | Quit Gilt |
/ | Search commits or filter files/branches/stashes |
: | Open command palette (searchable menu of all actions) |
! | Run shell command (vim-style) |
PgUp/PgDn | Page up/down in lists |
+ | Cycle screen mode: normal/half/full |
\ | Toggle split diff (side-by-side) view |
L (capital) | Show recent repos (Enter to switch) |
E (capital) | Git-flow menu (feature/release/hotfix) |
z | Undo last git command (via reflog) |
Z | Redo last undone command |
M-c (Alt+c) | Clone repository dialog |
M-i (Alt+i) | Init repository dialog |
Files Panel [2]
| Key | Action |
|---|---|
Space | Stage/unstage selected file |
a | Stage all / unstage all toggle |
e | Edit file (conflicts) or enter hunk staging mode |
T (capital) | Toggle file tree view (flat/tree) |
v | Range select (start/end, then stage/unstage range) |
I (capital) | Add file to .gitignore |
x | Launch external diff tool |
y | Copy file path to clipboard |
b | Blame view - show git blame for file |
d | Discard changes to selected file |
o | Resolve conflict with "ours" (your version) |
t | Resolve conflict with "theirs" (incoming version) |
X (capital) | Abort merge in progress |
s | Stash all changes |
S (capital) | Stash selected file(s) with optional message |
c | Open commit dialog |
C (capital) | Commit with $EDITOR (suspends TUI) |
w | Cycle: Files → Worktrees → Stashes |
W (capital) | Commit without pre-commit hook |
P (capital) | Push to remote (with Force Push option) |
p (lowercase) | Pull from remote (with rebase/ff-only options) |
= | Toggle numstat display (+N -M per file) |
K (capital) | git clean - dry-run preview and confirm |
A (capital) | Apply patch (git apply / git am) |
M (capital) | Detect and resolve submodule conflicts |
Worktrees View (in Files Panel)
Press w in the Files panel to cycle to Worktrees view.
| Key | Action |
|---|---|
w | Cycle to next view |
A (capital) | Add new worktree |
D (capital) | Remove selected worktree |
Worktrees are color-coded:
- Green = Normal worktree with branch
- Yellow = Detached HEAD
- Red = Locked worktree
- Gray = Bare repository
Stashes View (in Files Panel)
Press w in the Files panel to cycle to Stashes view.
| Key | Action |
|---|---|
w | Cycle to next view |
Enter | Apply selected stash (keep stash) |
p or P | Pop selected stash (apply and remove) |
B (capital) | Create new branch from stash |
R (capital) | Rename stash |
D (capital) | Drop selected stash |
0 | Focus main panel to scroll stash diff with j/k |
Branches Panel [3]
| Key | Action |
|---|---|
Enter | Checkout branch (local) or track remote branch |
n | Create new branch |
w | Cycle: Local → Remotes → Tags → Submodules |
f | Fetch (select remote) |
M (capital) | Merge selected branch into current |
R (capital) | Rebase current branch onto selected branch |
N (capital) | Rename selected branch |
F (capital) | Fast-forward branch to match upstream |
u | Set/unset upstream tracking branch |
s | Sort branches (name/date/recent) |
y | Copy branch name to clipboard |
o | Open branch in browser |
O (capital) | Create pull request for branch (opens browser) |
Enter | Enter submodule (in Submodules view) |
D (capital) | Delete selected branch (or bulk delete selected) |
C (capital) | Cherry-pick commits from selected branch |
Space | Toggle branch selection for bulk operations |
% | Toggle ahead/behind divergence indicators |
G (capital) | Toggle all-branches commit graph mode |
Remotes View (in Branches Panel)
Press w once from Local branches to reach Remotes view.
| Key | Action |
|---|---|
A (capital) | Add new remote |
R (capital) | Rename selected remote |
D (capital) | Delete selected remote branch |
w | Cycle to Tags view |
Tags View (in Branches Panel)
Press w twice from Local branches to reach Tags view.
| Key | Action |
|---|---|
t | Create tag on HEAD |
T (capital) | Push tag to remote |
Space | Checkout tag as detached HEAD |
D (capital) | Delete selected tag |
w | Cycle to Submodules view |
Submodules View (in Branches Panel)
Press w three times from Local branches to reach Submodules view.
| Key | Action |
|---|---|
U (capital) | Update selected submodule (or all) |
w | Cycle back to Local branches |
Commits Panel [4]
| Key | Action |
|---|---|
/ | Search commits by message or author |
t | Create tag on selected commit |
A (capital) | Amend HEAD commit (with or without new message) |
X (capital) | Reset to commit (Soft/Mixed/Hard options) |
F (capital) | Create fixup! commit for autosquash |
S (capital) | Squash commits (select target commit) |
C (capital) | Cherry-pick selected commit |
R (capital) | Revert selected commit |
g | Toggle commit graph view (all branches) |
i | Interactive rebase (select range, then mark actions) |
b | Start bisect (then b:bad g:good Q:reset) |
y | Copy commit hash to clipboard |
o | Open commit in browser |
N (capital) | Add/edit git note for selected commit |
F (capital) | Format patch for selected commit |
Space | Toggle commit selection for multi-cherry-pick (shown with +) |
V (capital) | Cherry-pick all copied commits (paste) |
T (capital) | Browse tree/blob at selected commit |
Stash Panel [5]
| Key | Action |
|---|---|
s | Create new stash |
g | Pop (apply and remove) top stash |
D (capital) | Drop selected stash |
Config Viewer
Press G (capital) to toggle the config viewer in the main panel.
| Key | Action |
|---|---|
G (capital) | Toggle config viewer on/off |
w | Cycle scope: All → Local → Global → System |
Escape | Exit config viewer |
j/k or arrows | Navigate config entries |
Config entries are color-coded by scope:
- Green = Local (repo-specific)
- Yellow = Global (user-level)
- Cyan = System (system-wide)
Dialog Navigation
| Key | Action |
|---|---|
Tab | Switch between buttons/input |
Enter | Confirm action (or newline in multiline input) |
Escape | Cancel dialog |
Backspace | Delete character |
Common Workflows
Staging and Committing Changes
- Navigate to the Files panel (
Tabor press2) - Use
j/kto select a file - Press
Spaceto stage/unstage the file - Or press
ato stage all files - Press
cto open the commit dialog - Type your commit message (multiline supported)
- Press
Tabto select the "Commit" button - Press
Enterto confirm
Partial Staging (Hunk Mode)
Stage only specific parts of a file:
- Select an unstaged modified file in the Files panel
- Press
eto enter hunk staging mode - The Main panel shows individual hunks
- Use
j/kto navigate hunks - Press
Spaceto stage a specific hunk - Press
Enterto enter line-level staging for the selected hunk - Press
Escapeto exit hunk mode
Line-Level Staging
Stage individual lines within a hunk for precise control:
- Enter hunk mode (
eon a modified file) - Press
Enteron a hunk to see its individual diff lines - Lines are shown with markers:
○(unselected) and●(selected) - Use
j/kto navigate lines - Press
Spaceto toggle a line's selection (only+and-lines can be toggled) - Press
ato select all changed lines,nto deselect all - Press
Enterto stage only the selected lines - Press
Escapeto go back to the hunk list
This is a power-user feature that lets you commit exactly the lines you want, even within a single hunk.
Creating a New Branch
- Navigate to the Branches panel (
Tabor press3) - Press
nto open the new branch dialog - Type the branch name
- Press
Enterto create and checkout the new branch
Merging Branches
- Make sure you're on the target branch (the one you want to merge INTO)
- Navigate to the Branches panel
- Select the branch you want to merge FROM
- Press
M(capital) to merge - Confirm in the dialog
Squashing Commits
Combine multiple commits into one:
- Navigate to the Commits panel (
Tabor press4) - Select the oldest commit you want to include in the squash
- For example, to squash the last 3 commits, select the 3rd commit from the top
- Press
S(capital) to squash - Enter a new commit message for the combined commit
- Press
Tabto select "Squash", thenEnter
Cherry-Picking a Commit
Apply a specific commit to your current branch:
- Navigate to the Commits panel
- Select the commit you want to cherry-pick
- Press
C(capital) - Confirm in the dialog
Reverting a Commit
Create a new commit that undoes a previous commit:
- Navigate to the Commits panel
- Select the commit you want to revert
- Press
R(capital) - Confirm in the dialog (creates a new revert commit)
Viewing Git Blame
See who last modified each line of a file:
- Navigate to the Files panel (
Tabor press2) - Select a file
- Press
bto enter blame view - The Main panel shows blame info: commit hash, author, line number, content
- Use
j/kto navigate lines - Press
Enterto see full commit details for the selected line - Press
Escapeto exit blame view
Searching Commits
Filter the commit log by message or author:
- Navigate to the Commits panel (
Tabor press4) - Press
/to open the search dialog - Type your search term (matches commit messages and author names)
- Press
Enterto search - Results are displayed with matches highlighted
- Press
/again to search for something else - Press
Escapeto exit search mode and return to full commit list
Cherry-Picking from Another Branch
Apply commits from another branch to your current branch:
- Navigate to the Branches panel (
Tabor press3) - Select the branch you want to cherry-pick FROM (not your current branch)
- Press
C(capital) - The Main panel shows commits unique to that branch
- Use
j/kto select a commit - Press
EnterorCto cherry-pick the selected commit - Confirm in the dialog
- Press
Escapeto exit without cherry-picking
Interactive Rebase
Rewrite commit history with full control over each commit:
- Navigate to the Commits panel (
Tabor press4) - Select the oldest commit you want to include in the rebase
- For example, to rebase the last 3 commits, select the 3rd commit from the top
- Press
ito enter interactive rebase mode - The panel title changes to show available actions
- For each commit, press a key to set its action:
p- pick (keep commit as-is)r- reword (change commit message, opens input dialog)s- squash (combine with previous commit, not available on first)f- fixup (like squash but discard this commit's message)d- drop (remove commit entirely)
- Use
J/K(capital) to reorder commits - Press
Enterto execute the rebase, orqto cancel
Actions are color-coded:
- Green = pick
- Cyan = reword
- Magenta = squash/fixup
- Red = drop
Note: Squash and fixup cannot be applied to the first commit in the list (there is no preceding commit to combine into).
Rebasing onto Another Branch
Rebase your current branch onto a different branch:
- Navigate to the Branches panel (
Tabor press3) - Select the branch you want to rebase ONTO (the base branch)
- Press
R(capital) to rebase - Confirm in the dialog
This is equivalent to git rebase <selected-branch> and replays your current branch's commits on top of the selected branch.
Stashing Changes
Temporarily save your changes:
- Press
sfrom the Files panel or Stash panel to stash all changes - Navigate to the Stash panel to see stashed items
- Press
gto pop (apply and remove) the top stash
Pushing and Pulling
- Press
P(capital) from any panel to push - Press
p(lowercase) from any panel to pull - A status indicator shows "Pushing..." or "Pulling..." during the operation
- The push dialog includes a Force Push option (uses
--force-with-leasefor safety)
Bisecting (Finding Bad Commits)
Use binary search to find which commit introduced a bug:
- Navigate to the Commits panel (
Tabor press4) - Press
bto start bisect - marks the selected commit as bad - Navigate to a known good commit and press
gto mark it as good - Git will checkout a commit halfway between good and bad
- Test the code, then press
b(bad) org(good) to continue narrowing - Repeat until git identifies the first bad commit
- Press
Q(capital) to reset bisect and return to normal mode
Working with Remote Branches
Fetch, view, and track remote branches:
- Navigate to the Branches panel (
Tabor press3) - Press
fto fetch the latest from all remotes - Press
wto switch to Remotes view (panel title changes to "Remotes") - Remote branches are displayed in cyan (e.g.,
origin/main,origin/feature-branch) - Select a remote branch and press
Enterto create a local tracking branch - Press
wagain to switch back to Local branches view
Note: When you track a remote branch, Gilt creates a local branch with the same name (without the remote prefix) and checks it out automatically.
Resolving Merge Conflicts
When a merge results in conflicts, conflicted files appear with a red ! indicator:
- Navigate to the Files panel (
Tabor press2) - Conflicted files show
! filenamein bright red - For each conflicted file, you have three options:
- Press
eto edit the file in your$EDITOR(vim by default) - Press
oto use ours (keep your version, discard theirs) - Press
tto use theirs (keep incoming version, discard yours)
- Press
- After resolving all conflicts, press
cto commit the merge - If you want to cancel the merge entirely, press
X(capital) to abort
Editing conflicts manually:
- When you press
e, Gilt spawns your editor with the conflicted file - Look for conflict markers:
<<<<<<<,=======,>>>>>>> - Edit the file to resolve conflicts, save, and exit
- The file will still show as conflicted until you stage it with
Space
New Features (v0.18.0 - v0.19.0)
Command Palette
Quickly find and execute any command by name:
- Press
:from any panel - Type to filter the list of all available commands
- Use
j/kor arrow keys to navigate - Press
Enterto execute the selected command - Press
Escapeto cancel
The palette shows all actions with their shortcut keys, making it easy to discover features you may have forgotten.
Syntax Highlighting
View file content with syntax highlighting in the tree/blob view:
- Press
Ton the commits panel to browse a commit's tree - Select a file and press
Enterto view its content - If
bat(orbatcat) is installed, content is automatically syntax-highlighted - Press
H(capital) in tree mode to toggle highlighting on/off - Falls back to plain text with line numbers if bat is not installed
Split Diff View
View diffs side-by-side instead of inline:
- Select a file in the Files panel to see its diff
- Press
\(backslash) to toggle split diff mode - The main panel title changes to "Split Diff" when active
- Uses
git diff --side-by-sidewith 200-column width - Press
\again to return to normal inline diff view
Numstat in File List
See how many lines were added/removed per file:
- Navigate to the Files panel (
2) - Press
=to toggle numstat display - Each file shows
+N -Msuffix (e.g.,M src/git.lisp +42-18) - Press
=again to hide
Bulk Branch Operations
Select multiple branches and delete them all at once:
- Navigate to the Branches panel (
3) - Press
Spaceon branches to toggle selection (shown with+marker) - A toast shows the count of selected branches
- Press
D(capital) to open the bulk delete dialog - Confirm with "Delete All" or cancel
Commit Message Templates
Automatically pre-fill commit message prefixes based on branch name:
- Create
~/.config/gilt/commit-templates.conf - Add patterns in
pattern=prefixformat:feature/=feat: bugfix/=fix: hotfix/=fix: main=chore: - When you press
cto commit on a matching branch, the prefix is pre-filled - The dialog shows "Template prefix: feat:" as a hint
- See
commit-templates.example.conffor reference
Not-In-Repo Behavior
When you start gilt outside a git repository, you get an interactive menu:
[1]Initialize a new repository in the current directory[2]Clone a repository (prompts for URL)[3]Browse recent repositories (numbered list)[q]Quit
Successfully opened repos are saved to the recent repos list for future use.
Git Notes
Add, edit, or view git notes on any commit:
- Navigate to the Commits panel (
4) - Select a commit
- Press
N(capital) to open the Git Note dialog - If a note exists, it's pre-filled in the input
- Choose "Save" to add/update, "Delete" to remove, or "Cancel"
- Notes are displayed in the commit detail view (below the commit message)
git clean Integration
Preview and remove untracked files:
- Navigate to the Files panel (
2) - Press
K(capital) to preview what would be removed - The dialog shows a list of files/directories that
git cleanwould remove - Choose:
- "Clean -fd" to remove untracked files and directories
- "Clean -fdx" to also remove ignored files
- "Cancel" to abort
- If nothing to clean, a toast says "Nothing to clean"
Format-Patch / Apply-Patch
Export and import commits as patch files:
Creating a patch:
- Navigate to the Commits panel (
4) - Select a commit
- Press
F(capital) to create a patch file - A toast shows the generated filename (e.g.,
0001-commit-msg.patch)
Applying a patch:
- Navigate to the Files panel (
2) - Press
A(capital) to open the Apply Patch dialog - Enter the patch file path
- Choose:
- "Apply (git apply)" to apply changes to working tree
- "Apply (git am)" to apply and create a commit
- "Check" to verify the patch applies cleanly without changing anything
- "Cancel" to abort
Submodule Conflict Resolution
Detect and resolve merge conflicts in submodules:
- Navigate to the Files panel (
2) - Press
M(capital) to check for submodule conflicts - If conflicts exist, a dialog lists them and offers:
- "Resolve (ours)" to take your version
- "Resolve (theirs)" to take their version
- "Cancel" to resolve manually
- If no conflicts, a toast says "No submodule conflicts"
Divergence Indicators
See how far each branch has diverged from its upstream:
- Navigate to the Branches panel (
3) - Press
%to toggle divergence indicators - Each branch shows
↑N↓M(ahead N, behind M) vs its upstream - Ahead count is green, behind count is red
- Press
%again to hide
Configurable Keybindings
Customize keybindings via a config file:
- Create
~/.config/gilt/keybindings.conf - Define context-specific bindings:
[global] q=quit r=refresh [files] s=stage u=unstage - See
keybindings.example.conffor all available contexts and actions
Clone/Init from UI
Clone or initialize repositories without leaving gilt:
- Press
M-c(Alt+c) to open the Clone dialog - Press
M-i(Alt+i) to open the Init dialog - Both prompt for URL/path and execute the operation
Troubleshooting
Terminal Issues
| Problem | Solution |
|---|---|
| Colors not displaying | Ensure your terminal supports 256 colors (TERM=xterm-256color) |
| Box characters broken | Use a font with Unicode box-drawing support (e.g., JetBrains Mono, Fira Code) |
| Keys not working | Some terminals send different escape sequences; try a different terminal emulator |
| Backspace not working | Try Ctrl+H as an alternative |
Git Issues
| Problem | Solution |
|---|---|
| No files showing | Make sure you're in a Git repository |
| Push/pull slow | Network operations depend on your connection and remote server |
| Merge conflicts | Resolve conflicts in your editor, then stage the resolved files |
Getting Help
- Press
Tabto see context-sensitive keybindings in the help bar at the bottom - Check the Command Log panel to see what Git commands are being executed
Cross-Platform Support
Gilt works on various Unix systems including NixOS, standard Linux distributions, macOS, and WSL2.
Environment Variables
| Variable | Description | Example |
|---|---|---|
GILT_ESCAPE_TIMEOUT | Escape sequence timeout (seconds) | 0.01 |
Since v0.13.0, Gilt uses FFI-based terminal control (POSIX termios) and no longer depends on stty or any external terminal utilities. As of v0.15.0, Gilt supports line-level staging, commit graph view, stash individual files, mouse scroll wheel, and context-sensitive panel titles for all modes.
Diagnostics
Run the diagnostic script to test system compatibility:
sbcl --load diagnose.lisp
Tips and Tricks
- Quick panel switching - Use number keys
1-5to jump directly to a panel - View diffs - Select a file in the Files panel to see its diff in the Main panel
- Multiline commits - The commit dialog supports multiple lines; press
Enterto add new lines - Check command history - The Command Log shows all Git commands executed, useful for debugging
- Refresh data - Press
rto refresh all panels if data seems stale