Explain git rebase code

Paste the todo list from git rebase -i and Vibe explains what each line will do to your commits: pick, fixup, reword and drop, and why the branch needs a force push afterwards.

git-rebase-todo

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe19 lines selected

Press Explain it for the sample, or paste your own code first.

What this git rebase sample shows

pick, fixup and squash
Each line is one commit, oldest first, and git runs them from the top. pick keeps a commit as it is. The 2 fixup lines folded wip and fix typo into Add discount codes and kept only that commit's message, so the debug lines wip added and fix typo took out left no trace. With squash for wip and the other lines left as pick, git opened the message editor with both messages, Add discount codes and wip, for you to combine.
reword and drop
reword kept the change and stopped for a new message: Use discount in checkout became Apply discount codes at checkout. drop removed the Add gitignore commit, and its .gitignore file with it. The branch went from 5 commits to 2, and git printed Successfully rebased and updated refs/heads/feature/discounts.
new hashes and the push
A rebase writes new commits: the 2 left were 0076ae5 and 1279aa9, and none of the old hashes was on the branch any more. The copy on the remote still pointed at the old tip, 803b36d, so a plain git push was rejected as non-fast-forward. git push --force-with-lease replaced it, and printed forced update.
reordering
Lines can be moved, and git applies them in the new order. With fix typo moved above wip, the rebase stopped at fix typo with The previous cherry-pick is now empty, because the debug lines it takes out weren't there yet, and exited with code 1. git rebase --abort put the branch back to all 5 commits.

Good to know

  • Run with git 2.55.0 on Linux in a test repo: main with one commit, and a feature/discounts branch of 5 commits by a test author. GIT_SEQUENCE_EDITOR supplied the edited todo list and GIT_EDITOR the new message, in place of an editor window. The todo list above is the one git wrote, with the 5 commands edited and 17 of its 30 help lines left out.
  • Deleting every line stopped the rebase with error: nothing to do and left all 5 commits as they were.

Watch out: Deleting a line drops that commit, and git doesn't ask. With the Add gitignore line deleted instead of marked drop, the rebase printed Successfully rebased, exited with code 0, and .gitignore was gone from the branch. The old commits stay in the repo for a while, and git kept the old tip in ORIG_HEAD, 803b36d here. Because the dropped commit was that tip, git cherry-pick 803b36d brought it back.

Explain git rebase code beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

Opening the .dmg the first time
  1. Open the .dmg and drag Unvibe to Applications.
  2. Open it once; macOS says it can't verify it. Click Done.
    macOS dialog: Unvibe Not Opened, with Done and Move to Trash
    Real screen, macOS 15
  3. System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open