Show HN: Git-knife – edit commit messages, authors, and dates like a spreadsheet
🔪 git-knife: Sculpt Your Git History Like a Spreadsheet
git-knife is a dedicated desktop GUI designed to let you "stab" your git history into the perfect shape. It treats your commit metadata—including messages, authors, and timestamps—as an editable table.
🎯 The Problem & The Solution
While popular GUIs like GitKraken, Sublime Merge, Fork, or lazygit are excellent for rewording messages or reordering commits, they generally treat commit dates as immutable. Furthermore, they rarely expose the "committer date" or allow for the modification of author identities across arbitrary commits.
On the other hand, powerful CLI tools like git-filter-repo or complex git rebase environment tricks can handle this, but they lack a visual interface.
git-knife fills this gap. It provides a polished GUI for bulk-editing every metadata field safely.
🛠️ Technical Approach
It is important to note that git-knife does not reimplement git. Instead, it:
- Shells out to the system's
gitCLI. - Utilizes
git commit-treeto rebuild commits. - Reuses the original commit's tree, ensuring that file contents are provably unchanged.
📊 Competitive Landscape
| Tool | Clean GUI | Reword Msg | Reorder/Squash | Edit Author Date | Edit Committer Date | Edit Author/Email | Bulk Regex Replace |
|---|---|---|---|---|---|---|---|
| git-knife | ✅ | ✅ | 🚧 Planned | ✅ | ✅ | ✅ | ✅ |
| GitKraken | ✅ | ✅ | ✅ | ⚠️ Amend only | ❌ | ⚠️ | ❌ |
| Sublime Merge | ✅ | ✅ | ✅ | ❌ | ❌ | ⚠️ Amend | ❌ |
| Fork | ✅ | ✅ | ✅ | ❌ | ❌ | ⚠️ | ❌ |
| SmartGit | ✅ | ✅ | ✅ | ⚠️ | ❌ | ✅ | ❌ |
| git-cola | ◐ | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ |
| lazygit (TUI) | ◐ | ✅ | ✅ | ❌ | ❌ | ⚠️ | ❌ |
| git-filter-repo | ❌ | ✅ via callback | ✅ | ✅ | ✅ | ✅ | ✅ |
Legend: ✅ First-class ⚠️ Awkward/Limited ◐ Dated/TUI ❌ Not supported 🚧 Planned.
🚀 Project Status (MVP)
- Open a repository and list current branch commits.
- Edit: Message, Author Name/Email, Author Date, Committer Date, and Committer Name/Email.
- Bulk find-and-replace (Literal or Regex) across text fields.
- Preview changes before final application.
- Automatic backup refs with one-click restoration.
- Warnings for rewrites affecting pushed history.
-
Reorder, squash, or drop commits(Coming soon). -
Merge commit rewriting(Coming soon). -
Staging, branch, and remote management(Coming soon). - Merge commits are currently locked.
💻 Installation & Development
Prerequisites
- Git: version 2.x
- Node.js + pnpm: (Enable via
corepack enable pnpmornpm i -g pnpm) - Rust: Stable version via rustup.rs
- Linux Dependencies (Tauri v2):
webkit2gtk-4.1,libgtk-3,libayatana-appindicator3,librsvg2
Debian/Ubuntu Install Command:
sudo apt install libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev
Running the App
# Install dependencies
pnpm install
# Launch in development mode
pnpm tauri dev
Note: The initial cargo build may take several minutes to compile Tauri crates.
Building the Bundle
pnpm tauri build
To update app icons, use a square PNG: pnpm tauri icon path/to/icon.png.
CI/CD
Automated releases are handled via .github/workflows/release.yml using tauri-action. To trigger a release:
git tag v0.1.0
git push origin v0.1.0
Note: Builds are currently unsigned for macOS/Windows.
📖 User Guide
Editing History
- Open Repo: Browse for your folder or paste the path.
- Modify: Edit the table. Changed rows are highlighted; UTC offsets are preserved.
- Apply: Click
Review applycheck the "Old New" preview Confirm.
Important: git-knife never contacts remotes or pushes automatically.
Bulk Find & Replace
Use the Bulk find replace tool to modify multiple commits simultaneously:
- Target: Select fields (e.g., Author Email + Committer Email).
- Mode: Use Regex (supports
$1backreferences) or Literal. - Workflow:
Stage editsReview apply.
Example: Changing old@email.com to new@email.com across the entire history.
Pushing Rewritten History
Because changing metadata alters the commit hash, the local and remote branches will diverge. Mathematically, the new hash is a function of the modified metadata:
The Safe Way to Push
Avoid git push --force. Instead, use:
git push --force-with-lease origin <branch>
--force-with-lease prevents you from accidentally overwriting a teammate's work if the remote has moved since your last fetch.
Handling Shared History
If you rewrite commits that others have already pulled, they must re-sync:
git fetch origin
git reset --hard origin/<branch>
Warning: This discards local-only commits. Coordinate with your team first!
Undoing Changes
If a rewrite goes wrong, you have two options:
- In-App: Use the Backups panel for a one-click restore.
- CLI: Find the backup ref and reset:
git for-each-ref refs/knife-backup git reset --hard <backup-ref-or-hash>