• Stars
    star
    1,538
  • Rank 30,420 (Top 0.6 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created almost 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Crates.io Packaging status GitHub license Coverage Status

Git Interactive Rebase Tool

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

Git Interactive Rebase Tool

Table of Contents

Features

Cross-platform

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

Set action

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

Basic operations

Reorder rebase list

Reorder the action list with a single key press.

Reorder items

Multiline modification

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

Visual mode

Toggle breaks

Toggle breaks

View commit details and diff

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

Commit overview

Commit diff

Unicode and Emoji support

Unicode support

Emoji support

Edit exec command

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

exec action command edit

Edit in external editor

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

Setup

Most systems

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

Windows

Standard Command Prompt and Windows Terminal

git config --global sequence.editor "'C:/path/to/interactive-rebase-tool.exe'"

GitBash

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"

Notes

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.

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

Direct 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 using the ? key.

Common Default Key Bindings

Key bindings can be customized, see configuration for all key bindings and information on configuring.

Key Mode Description
? All Show help
Up Normal/Diff Move selection up
Down Normal/Diff Move selection down
Page Up Normal/Diff Move selection up five lines
Page Down Normal/Diff Move selection down five lines
Home Normal/Diff Move selection to start of list
End Normal/Diff Move selection to home of list
q Normal/Diff Abort interactive rebase
Q Normal/Diff Immediately abort interactive rebase
w Normal/Diff Write interactive rebase file
W Normal/Diff Immediately write interactive rebase file
j Normal/Diff Move selected commit(s) down
k Normal/Diff Move selected commit(s) up
b Normal Toggle break action
p Normal/Diff Set selected commit(s) to be picked
r Normal/Diff Set selected commit(s) to be reworded
e Normal/Diff Set selected commit(s) to be edited
s Normal/Diff Set selected commit(s) to be squashed
f Normal/Diff Set selected commit(s) to be fixed-up
d Normal/Diff Set selected commit(s) to be dropped
E Normal Edit the command of an editable action
v Normal/Diff Enter and exit visual mode
I Normal Insert a new line
Delete Normal/Diff Remove selected lines
! Normal/Diff Open todo file in external editor
Control+z Normal/Diff Undo the previous change
Control+y Normal/Diff Redo the previously undone change
c Normal/Diff Show commit information
Down Diff Scroll view down
Up Diff Scroll view up
Left Diff Scroll view left
Right Diff Scroll view right
Home Diff Scroll view to the top
End Diff Scroll view to the end
PageUp Diff Scroll view a step up
PageDown Diff Scroll view a step down
d Diff Show full commit diff

Supported Platforms

Linux

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.

macOS

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

The tool is tested in iTerm2 and Terminal.

Windows

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

The tool is tested on Windows 10 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.

Others

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.

Development

Install Rust

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

Setup

Cargo Make

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

cargo install --force cargo-make

Debian and derivatives

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

Build and run

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.

Tests

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

cargo make test

Docs

API docs for the project are generated using Rust Doc:

cargo make docs

Linting

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.

Format

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

cargo make format

Coverage

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.

Release

Building
cargo make deb

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

Related Projects

License

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.

More Repositories

1

battery-notify

A battery notification system for Linux Mint
Shell
21
star
2

node-server-shutdown

Safely shutdown any number of HTTP and WebSocket servers in node
JavaScript
12
star
3

dotfiles

My personal dot files
Shell
5
star
4

http-authorization-header

Parse and create HTTP Authorization headers.
JavaScript
4
star
5

jekyll-prism-plugin

Provides support for prisim in Jekyll, including plugin support.
Ruby
4
star
6

node-sql-template-engine

A template engine compatible with SQL files.
TypeScript
3
star
7

Framework

A simple MVC PHP framework. Currently in Alpha and abandoned.
PHP
3
star
8

rsync-backup

A wrapper around rsync to create a remote backup of any set of files.
Shell
3
star
9

house-data-scrape

Scrape of housing data for St. John's Metro Area
JavaScript
3
star
10

advent-of-code-2023

Rust
2
star
11

mitmaro-build-scripts

Set of Bash scripts used for building projects
Shell
2
star
12

auth0-ip-block-status

Auth0 Exercise - IP Block List Downloader and micro-service
JavaScript
2
star
13

combokeys-context

Wrapper around Combokeys that provides support for context/scope.
JavaScript
2
star
14

advent-of-code-2021

Advent of Code - 2021
Rust
2
star
15

MUN-School-Work

Work I have done in my various classes at MUN
Java
2
star
16

server-rsync-backup

A wrapper around rsync to create backups from remote systems of any set of files on a schedule.
Shell
2
star
17

linux-ansible-setup

Shell
2
star
18

eslint-config-mitmaro

My personal ESLint configuration
JavaScript
2
star
19

kattis-runner

A Kattis solution runner
JavaScript
2
star
20

script-email-notifier

A script runner that will automatically send an email on script failure.
Shell
2
star
21

tasks

A task list switcher for t
Shell
1
star
22

advent-of-code-2019

Advent of Code - 2019
Rust
1
star
23

ReactJestUtil

A library of utility functions that assist in mocking React components when using Jest.
JavaScript
1
star
24

mitmaro.github.io

My personal website.
Ruby
1
star
25

code.review

Upcoming project
JavaScript
1
star
26

dotprofile

My bash profile
Shell
1
star
27

node-dependency-manager

A node dependency loader and manager
JavaScript
1
star
28

captur

A macro to capture the struct within the closure, ensuring the correct drop order.
Rust
1
star
29

RoboTim

A IRC Bot Framework
Java
1
star
30

Euler

Project Euler Solutions
C
1
star
31

The-Blame-Game

A game for tracking who made and fixed bugs introduced by developers.
Python
1
star
32

LightOpenID

An PHP 5 library for easy openid authentication.
PHP
1
star
33

protohackers

Rust
1
star
34

sudoku-validator

Some fun wuth Rust threads!
Rust
1
star
35

Java-Common

Some common java packages that can be reused. I mostly wrote them for doing assignments quickly at MUN.
Java
1
star
36

node-skeleton

A sample skeleton application that can be used for creating node projects.
Shell
1
star
37

MUN-CS-Society-Website

The Memorial University of Newfoundland Computer Science Society Website
JavaScript
1
star
38

eslint-plugin-strict-newline

ESLint plugin that provides a rule for newline spacing around 'use strict'
JavaScript
1
star