Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

MitMaro/git-interactive-rebase-tool

Native cross-platform full feature terminal-based sequence editor for git interactive rebase.

MitMaro/git-interactive-rebase-tool.json
{
"createdAt": "2016-12-21T03:13:07Z",
"defaultBranch": "master",
"description": "Native cross-platform full feature terminal-based sequence editor for git interactive rebase.",
"fullName": "MitMaro/git-interactive-rebase-tool",
"homepage": "https://gitrebasetool.mitmaro.ca/",
"language": "Rust",
"name": "git-interactive-rebase-tool",
"pushedAt": "2025-06-08T14:55:30Z",
"stargazersCount": 1712,
"topics": [
"cross-platform",
"editor",
"git",
"hacktoberfest",
"rust"
],
"updatedAt": "2025-11-24T21:20:29Z",
"url": "https://github.com/MitMaro/git-interactive-rebase-tool"
}

Crates.io Packaging status GitHub license Coverage Status

Native cross-platform full-featured terminal-based sequence editor for interactive rebase in Git 1.7.8+.

![Git Interactive Rebase Tool]!(/docs/assets/images/girt-demo.gif?raw=true)

  • [Features]!(#features)
  • [Install]!(./readme/install.md)
  • [Setup]!(#setup)
  • [Usage]!(#direct-usage)
  • [Customization]!(./readme/customization.md)
  • [Development]!(#development)
  • [Related Projects]!(#related-projects)
  • License!(#license)

Built and works on Linux, macOS, Windows, and many others.

Easily set the action to pick, squash, fixup, edit, reword and drop.

![Basic operations]!(/docs/assets/images/girt-set-actions.gif?raw=true)

Reorder the action list with a single key press.

![Reorder items]!(/docs/assets/images/girt-reorder.gif?raw=true)

Change action and reorder multiple lines at once with visual mode.

![Visual mode]!(/docs/assets/images/girt-visual-mode.gif?raw=true)

![Toggle breaks]!(/docs/assets/images/girt-break.gif?raw=true)

View the commit overview, and a full commit diff with a press of a key.

![Commit overview]!(/docs/assets/images/girt-commit-overview.gif?raw=true)

![Commit diff]!(/docs/assets/images/girt-commit-diff.gif?raw=true)

![Unicode support]!(/docs/assets/images/girt-unicode.png?raw=true)

![Emoji support]!(/docs/assets/images/girt-emoji.png?raw=true)

Easily edit the command that is run by an exec command.

![exec action command edit]!(/docs/assets/images/girt-edit.gif?raw=true)

Need to do something in your Git editor? Quickly shell out to your editor, make a change and return to the tool.

![Shell out to editor]!(/docs/assets/images/girt-external-editor.gif?raw=true)

This optional feature allows for the injection of an exec action after modified lines, where modified is determined as a changed action, command, or reference. This can be used to amend commits to update references in the commit message or run a test suite only on modified commits.

To enable this option, set the interactive-rebase-tool.postModifiedLineExecCommand option, providing an executable or script.

Terminal window
git config --global interactive-rebase-tool.postModifiedLineExecCommand "/path/to/global/script"

Or using repository-specific configuration, for targeted scripts.

Terminal window
git config --global interactive-rebase-tool.postModifiedLineExecCommand "/path/to/repo/script"

The first argument provided to the script will always be the action performed. Then, depending on the action, the script will be provided a different set of arguments.

For drop, fixup, edit, pick, reword and squash actions, the script will additionally receive the original commit hash, for exec the original and new commands are provided, and for label, reset, merge, and update-ref the original label/reference and new label/reference are provided.

Full example of a resulting rebase todo file, assuming that interactive-rebase-tool.postModifiedLineExecCommand was set to script.sh.

# original line: label onto
label new-onto
exec script.sh "label" "onto" "new-onto"
# original line: reset onto
reset new-onto
exec script.sh "reset" "onto" "new-onto"
pick a12345 My feature
# original line: pick b12345 My change
squash b12345 My change
exec script.sh "squash" "b12345"
# original line: label branch
label branch
exec script.sh "label" "branch" "new-branch"
# original line: exec command
exec new-command
exec script.sh "exec" "command" "new-command"
Terminal window
git config --global sequence.editor interactive-rebase-tool

Standard Command Prompt and Windows Terminal

Section titled “Standard Command Prompt and Windows Terminal”
Terminal window
git config --global sequence.editor "'C:/path/to/interactive-rebase-tool.exe'"

Git Bash requires the use of winpty in order to work correctly, so to set the editor use:

Terminal window
git config --global sequence.editor "winpty /c/path/to/interactive-rebase-tool.exe"

Windows before version 10 has serious rendering issues with saturated darker colors, such as the blue color that is entirely illegible on modern displays. While it is possible to avoid using saturated colors, a better option is to update the theme using Microsoft’s ColorTool.

You can temporarily use a different sequence editor by using the GIT_SEQUENCE_EDITOR environment variable:

Terminal window
GIT_SEQUENCE_EDITOR=emacs git rebase -i [<upstream> [<branch>]]
Terminal window
interactive-rebase-tool <rebase-todo-filepath>
interactive-rebase-tool --help
interactive-rebase-tool --version

The tool has built-in help that can be accessed by using the ? key.

Key bindings can be customized, see [configuration]!(readme/customization.md#key-bindings) for all key bindings and information on configuring.

KeyModeDescription
?AllShow help
UpNormal/DiffMove selection up
DownNormal/DiffMove selection down
Page UpNormal/DiffMove selection up five lines
Page DownNormal/DiffMove selection down five lines
HomeNormal/DiffMove selection to start of list
EndNormal/DiffMove selection to home of list
qNormal/DiffAbort interactive rebase
QNormal/DiffImmediately abort interactive rebase
wNormal/DiffWrite interactive rebase file
WNormal/DiffImmediately write interactive rebase file
jNormal/DiffMove selected commit(s) down
kNormal/DiffMove selected commit(s) up
bNormalToggle break action
pNormal/DiffSet selected commit(s) to be picked
rNormal/DiffSet selected commit(s) to be reworded
eNormal/DiffSet selected commit(s) to be edited
sNormal/DiffSet selected commit(s) to be squashed
fNormal/DiffSet selected commit(s) to be fixed-up
dNormalSet selected commit(s) to be dropped
dDiffShow full commit diff
ENormalEdit the command of an editable action
vNormal/DiffEnter and exit visual mode (for selection)
INormalInsert a new line
Control+dNormalDuplicate the selected line
DeleteNormal/DiffRemove selected lines
!Normal/DiffOpen todo file in external editor
Control+zNormal/DiffUndo the previous change
Control+yNormal/DiffRedo the previously undone change
cNormal/DiffShow commit information
DownDiffScroll view down
UpDiffScroll view up
LeftDiffScroll view left
RightDiffScroll view right
HomeDiffScroll view to the top
EndDiffScroll view to the end
PageUpDiffScroll view a step up
PageDownDiffScroll view a step down

Supported on all Linux based distributions. The project is tested on Debian and Ubuntu, but should work on any standard Linux distribution. If the project is not working on your platform, please open an issue.

The tool is tested in Tilix and Gnome Terminal.

Supported on the latest version of macOS, though previous versions should work.

The tool is tested in iTerm2 and Terminal.

Supported on the latest versions of Windows 10 and Windows 11.

The tool is tested on Windows 11 in PowerShell and Command Prompt inside Windows Console and Windows Terminal. The latest version of Git Bash provided from Git for Windows is also supported.

Windows Console and Git Bash are only minimally supported, and some features or graphical glitches may occur. Windows Console running in legacy mode is not supported.

Cygwin is not officially supported.

Other platforms are not officially supported. Some platforms have community support, and if you are having trouble getting the project working on your platform, please open an issue.

To start developing the project, you will need to install Rust, which can generally be done using rustup.

This project uses cargo-make as a task runner. To install:

Terminal window
cargo install --force cargo-make

If you plan to build a release package you will need pkg-config and liblzma-dev. They can be installed using apt:

Terminal window
sudo apt install pkg-config liblzma-dev

To build or run the project, from the project root run:

Terminal window
# only build
cargo make build --release
# build and run
cargo run -- <path-to-git-rebase-todo-file>

Sample rebase todo files can be found in ./test/fixtures.

Automated tests are available for all features and can be run with:

Terminal window
cargo make test

API docs for the project are generated using Rust Doc:

Terminal window
cargo make docs

An addition to the lints provided by rustc, this project uses Clippy to provide additional linting, run with:

Terminal window
cargo make lint

This will run lints using stable and nightly. The nightly lints may show errors, but will not result in a failure.

This project uses rust-fmt to provide a consistent format. A helpful script will ensure that all files are formatted correctly:

Terminal window
cargo make format

The project use Tarpaulin to generate coverage reports. Coverage reports are used to find gaps in tests. To generate the coverage report:

Terminal window
cargo make coverage

An addition to the report printed to the CLI, an HTML report can be found in the coverage directory.

Terminal window
cargo make build-deb

A deb file will be written to target/debian/git-interactive-rebase-tool_*.deb.

Terminal window
cargo make build-rpm

A rpm file will be written to target/generate-rpm/git-interactive-rebase-tool-*.deb.

Providing a SOURCE_DATE_EPOCH environment variable with a valid Unix timestamp, defined in seconds, will ensure a reproducible build.

Copyright © 2017-2024 Tim Oram and Contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License can be found in the file [COPYING]!(COPYING).

See Third Party Licenses for licenses of the third-party libraries used by this project.