summaryrefslogtreecommitdiffstats
path: root/README.md
blob: c1a00497d4b74140293167e20ffdc9cc6478693b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Git Interactive Rebase Tool

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

![Image](git-interactive-tool.gif?raw=true)

## Install

#### Debian and derivatives

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

#### MacOS and OSX

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

### Configure Git

In your command line run:

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

## Usage

```shell
interactive-rebase-tool --version | -v | <rebase-todo-filepath>
```

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


## Development

### Install Rust

To start developing the project you will need to [install Rust](https://doc.rust-lang.org/book/getting-started.html),
which can generally be done using [rustup](https://www.rustup.rs/).

### 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 project root run:

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


### Release

##### Install Cargo Deb

Cargo Deb has not been released to creates.io so it will need to be installed from the GitHub repository.

    cargo install cargo-deb

##### Building

    cargo build --release
    cargo deb

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

## License

Git Interactive Rebase Tool is released under the ISC license. See [LICENSE](LICENSE).