#git #editor #tool #interactive #rebase

app git-interactive-rebase-tool

Full feature terminal based sequence editor for git interactive rebase. Written in Rust using ncurses.

4 releases (breaking)

0.7.0 Oct 28, 2018
0.6.0 Feb 13, 2018
0.5.0 Dec 29, 2017
0.4.0 Feb 11, 2017

#5 in Text editors

Download history 51/week @ 2018-11-15 24/week @ 2018-11-22 14/week @ 2018-11-29 10/week @ 2018-12-06 8/week @ 2018-12-13 17/week @ 2018-12-20 3/week @ 2018-12-27 9/week @ 2019-01-03 9/week @ 2019-01-10 13/week @ 2019-01-17 4/week @ 2019-01-24 3/week @ 2019-01-31 2/week @ 2019-02-07 4/week @ 2019-02-14 6/week @ 2019-02-21

73 downloads per month

ISC license

53KB
1.5K SLoC

Crates.io Build Status Build status GitHub license

Git Interactive Rebase Tool

Native cross-platform full feature terminal based sequence editor for interactive rebase in Git 1.7.8+. Written in Rust using ncurses.

Image

Install

Debian and derivatives

Install

Download the .deb file from the releases page and install. The executable will be installed to /usr/bin.

Configure Git
git config --global sequence.editor interactive-rebase-tool

MacOS and OSX

Install

Download the macos-interactive-rebase-tool from the releases page and copy it as interactive-rebase-tool to a location on your PATH.

Configure Git
git config --global sequence.editor interactive-rebase-tool

Windows

Note: Windows binaries are not fully tested. If you are having issues please report them.

Install

Download the tool from the releases page and save it to a known location. There are 32-bit and 64-bit versions if you are unsure which binary to download, you probably want the 64-bit build.

Configure Git
git config --global core.editor "'C:/path/to/interactive-rebase-tool'"

From source

Install

With Rust's package manager cargo, you can install git-interactive-rebase-tool via:

cargo install git-interactive-rebase-tool
Configure Git

Cargo adds git-interactive-rebase-tool automatically to your PATH, so you can simply run:

git config --global sequence.editor interactive-rebase-tool

Usage

interactive-rebase-tool <rebase-todo-filepath>
interactive-rebase-tool --help
interactive-rebase-tool --version

Getting Help

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

Key Bindings

Key Description
Up Move selection up
Down Move selection down
Page Up Move selection up five lines
Page Down Move selection down five lines
q Abort interactive rebase
Q Immediately abort interactive rebase
w Write interactive rebase file
W Immediately write interactive rebase file
? Show help
c Show commit information
j Move selected commit down
k Move selected commit up
p Set selected commit to be picked
r Set selected commit to be reworded
e Set selected commit to be edited
s Set selected commit to be squashed
f Set selected commit to be fixed-up
d Set selected commit to be dropped

Temporary Override

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>]]

Configuration

The tool can be configured using the git config command. Invalid values are ignored and the default used instead. String values are case-insensitive.

Example

git config --global interactive-rebase-tool.foregroundColor black

Options

Key Default Type Description
autoSelectNext false bool If true, auto select the next line after action modification
foregroundColor white Color Color used for most text and the UI
indicatorColor yellow Color Color used for text the indicates or needs to standout
errorColor red Color Color used for showing error messages
diffAddColor green Color Color used for lines added in a diff
diffRemoveColor red Color Color used for lines removed in a diff
pickColor green Color Color used for the pick action
rewordColor yellow Color Color used for the reword action
editColor blue Color Color used for the edit action
squashColor cyan Color Color used for the squash action
fixupColor magenta Color Color used for the fixup action
dropColor red Color Color used for the drop action

Valid Color Values

The valid colors are the eight original 8 ANSI colors. They are black, blue, cyan, green, magenta, red, white and yellow. Each terminal controls the exact color for these color names.

Development

Install Rust

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

Setup

Debian and derivatives

You will need build-essential and libncurses5-dev to build the project. Additionally, you will need pkg-config and liblzma-dev if you wish to build a release. They can be installed using apt-get:

sudo apt-get install build-essential libncurses5-dev
sudo apt-get install pkg-config liblzma-dev

Build and run

Use cargo to build and run the project. From the project root run:

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

Release

Install Cargo Deb
cargo install cargo-deb
Building
cargo build --release
cargo deb

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

TODO

  • Full support for exec action
  • Insert action
  • Configure key bindings

Related Projects

License

Git Interactive Rebase Tool is released under the ISC license. See LICENSE.

Dependencies

~8.5MB
~190K SLoC