2

From this question, I know it is possible to prefix/modify all commits from a git-interactive-rebase.

But is it possible to modify all to-be-renamed commits messages in a single action? For instance when you select the reword command to just take the modified message from that editor?

It is not only prefixing or replacing something. It is arbitrary modifications that can only be manually done

1 Answer 1

3

Rebase is usually a manual process, but there are some Unix-y ways of automating it:

Try setting $EDITOR to a sed command before running your rebase --continue. For example:

git rebase -i ... 

Replace the first line's pick with edit or e, then the rest of the lines with reword or r.

Save-exit, then run:

export EDITOR="sed -i -e 's/foo/bar/g'" git rebase --continue 

This'll replace all instances of foo in the commit message with bar.

Sign up to request clarification or add additional context in comments.

1 Comment

AFIU the OP asks a slightly different question — how to make git rebase to use texts after reword in the TODO file as the commit messages.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.