git-rebase-walk
- From
- Alejandro Colomar <alx@kernel.org>
- Date
- Oct 1, 2026, 11:58 UTC
- Message-ID
- <ar5KL4_IKXYbx3Sb@debian>
Hi!
I use this little command to apply iterative rebases, which are easier to handle when there are large conflicts. Are you interested in it?
$ cat $(which git-rebase-walk) #!/bin/bash
set -Eeufo pipefail;
git merge-base HEAD "$1" \
| xargs -I{} git log --oneline {}.."$1" \
| cut -f1 -d' ' \
| tac \
| while read -r c; do
git rebase "$c";
done;The source code is trivial, so I guess I don't need to explain much. It behaves quite nicely, IME.
You may of course want to adapt it a little bit for merging in git(1). I could help improve it a little bit.
Have a lovely day! Alex
-- <https://www.alejandro-colomar.es>