This can be done automatically using a custom editor:
#!/bin/bash # Save to rebase_editor.sh, chmod +x it file="$1" if head -n1 "$file" | egrep -q '^pick' "$file" ; then perl -pi -e 's/^pick/r/' "$file" fi
and then do:
GIT_EDITOR=./rebase_editor.sh git rebase -i <some-rev>
On the first call, our โeditorโ will receive a list of rebase -i
from rebase -i
, where it will change each pick
to r
(which is equal to reword
). In this mode, git
will immediately start calling our โeditorโ with a message about each re-committed commit (and without any pauses, which are usually performed in pick
mode, where you can change the fix itself).
source share