Native cross-platform full feature terminal based sequence editor for interactive rebase in Git 1.7.8+.
This is the documentation for the development build. For the current stable release, please use the 2.1.x documentation.
Built and works on Linux, macOS, Windows and BSD.
Easily set the action to pick
, squash
, fixup
, edit
, reword
and drop
.
Reorder the action list with a single key press.
Change action and reorder multiple lines at once with visual mode.
View the commit overview, and a full commit diff with a press of a key.
Easily edit the command that is run by an exec
command.
Need to do something in your Git editor? Quickly shell out to your editor, make a change and return to the tool.
git config --global sequence.editor interactive-rebase-tool
git config --global sequence.editor "'C:/path/to/interactive-rebase-tool.exe'"
GitBash requires the use of winpty
in order to work correctly, so to set the editor use:
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:
GIT_SEQUENCE_EDITOR=emacs git rebase -i [<upstream> [<branch>]]
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 hitting the ?
key.
Key bindings can be configured, see configuration for more information.
Key | Mode | Description |
---|---|---|
Up | All | Move selection up |
Down | All | Move selection down |
Page Up | All | Move selection up five lines |
Page Down | All | Move selection down five lines |
Home | All | Move selection to start of list |
End | All | Move selection to home of list |
q |
Normal | Abort interactive rebase |
Q |
Normal | Immediately abort interactive rebase |
w |
Normal | Write interactive rebase file |
W |
Normal | Immediately write interactive rebase file |
? |
All | Show help |
c |
Normal | Show commit information |
j |
All | Move selected commit(s) down |
k |
All | Move selected commit(s) up |
b |
Normal | Toggle break action |
p |
All | Set selected commit(s) to be picked |
r |
All | Set selected commit(s) to be reworded |
e |
All | Set selected commit(s) to be edited |
s |
All | Set selected commit(s) to be squashed |
f |
All | Set selected commit(s) to be fixed-up |
d |
All | Set selected commit(s) to be dropped |
E |
Normal | Edit the command of an exec action |
v |
All | Enter and exit visual mode |
d |
Diff | Show full commit diff |
I |
Normal | Insert a new line |
Delete |
All | Remove selected lines |
Control+z |
All | Undo the previous change |
Control+y |
All | Redo the previously undone change |
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:
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
:
sudo apt install pkg-config liblzma-dev
To build or run the project, from the project root run:
# 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:
cargo make test
API docs for the project are generated using Rust Doc:
cargo make docs
An addition to the lints provided by rustc, this project uses Clippy to provide additional linting, run with:
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:
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:
cargo make coverage
An addition to the report printed to the CLI, an HTML report can be found in the coverage
directory.
cargo make deb
A deb file will be written to target/debian/interactive-rebase-tool_*.deb
.
- rebase-editor is a very similar project written in Node.js.
- cj-git-patchtool is another tool for doing git rebase en masse.
Git Interactive Rebase Tool is released under the GPLv3 license. See LICENSE.
See Third Party Licenses for licenses of the third-party libraries used by this project.