git rebase --interactive
(or git rebase -i
) is a great command. The Swiss army knife in git.
Many of us are using it daily,
I will explain how to make its usage easier.
Note: if you're not familiar with it. You can look at the bottom of my article where I give you resources to discover it.
When dealing with git interactive rebase, git
opens your $EDITOR
by default, so your editor is opened with a text file where you can reorder the line to reorder the commits, replace pick
by fixup
, squash
, drop
…. It's convenient, but there is a tool to make things easier.
MitMaro / git-interactive-rebase-tool
Native cross-platform full feature terminal-based sequence editor for git interactive rebase.
Git Interactive Rebase Tool
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.3.x documentation.
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
.
Reorder rebase list
Reorder the action list with a single key press.
Multiline modification
Change action and reorder multiple lines at once with visual mode.
Toggle break
s
View commit details and diff
View the commit overview, and a full commit diff with a press of a key.
Unicode and Emoji support
Edit exec
command
Easily edit the command that is run by an exec
command.
Edit in external editor
…It relies on the ability to define a specific editor for git
rebase --interactive
This tool is amazing! It changed my life. Here is what it looks like and allows:
Choose the action by pressing a single key
There are others features you will discover by reading the documentation.
The maintainers are currently working on a new version, so I recommend you using the last stable version, here is the documentation
https://github.com/MitMaro/git-interactive-rebase-tool/blob/2.3.0/README.md
about git rebase interactive
If you want to discover git rebase interactive, you can read these posts:
Advanced GIT tutorial - Interactive rebase
Marcell Lipp ・ Mar 12 '20
How do you use git rebase? Let's go through one use case
Schalk Neethling ・ Apr 23
This last post made by @schalkneethling inspired me to talk about this tool that changed my life.
Image credits: Tim Oram (@mitmaro) on GitHub and dev.to the git-interactive-rebase-tool
maintainer.
Top comments (1)
Thank you for sharing this and the shoutout!