Skip to content

anttti/fup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fup

Interactive git commit --fixup + autosquash in one keystroke.

Stage the changes you want folded into a previous commit, run fup, pick the target commit with the arrow keys, hit Enter. fup creates the fixup commit, autosquashes the history, and restores any unstaged leftovers via the stash.

Install

Requires Go 1.24+ and git on PATH.

go install github.com/anttti/fup@latest

Or from a checkout:

git clone https://github.com/anttti/fup
cd fup
go build -o fup .

Usage

git add -p             # stage the changes destined for an older commit
fup                    # pick the target, done

Keys in the picker:

Key Action
/ k move up
/ j move down
pgup / pgdn page up / down
g / G top / bottom
enter fix up into commit
q / esc cancel

What it does, in order

  1. Checks you're in a git work tree, no rebase/merge/cherry-pick is in progress, and there's at least one staged change.
  2. Shows the last N commits of HEAD (default 20, -n N to override).
  3. On selection:
    1. If you have unstaged tracked changes or untracked files, stashes them with git stash push --keep-index --include-untracked.
    2. git commit --fixup=<sha>.
    3. git rebase -i --autosquash <sha>^ with GIT_SEQUENCE_EDITOR=: so the todo list is accepted non-interactively.
    4. git stash pop if step 1 actually stashed anything.

Flags

  • -n N — number of commits shown in the picker (default 20).

Conflicts

If autosquash can't cleanly apply the fixup, fup leaves the rebase in progress and keeps the stash intact. Resolve the conflict, then:

git rebase --continue
git stash pop          # only if fup told you it stashed

Why

Doing this by hand is five commands and a SHA lookup; doing it wrong leaves a stash dangling or a fixup! commit in your history. fup is a thin wrapper around git — no go-git, no magic — so your hooks and config apply as usual.

About

git fixup dance but with less typing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages