0

Given a commit history that looks somewhat like

A---B---C---D master
     \       \
      S---T---U---V feature

I need to reword all commits of the feature branch, leaving all other commits unchanged. The result should be

A---B---C---D master
     \       \
      S'--T'--U'--V' feature

If I only had to reword commits since the last merge of master into feature, I would usually do an interactive rebase from V. If I try to do an interactive rebase from S, it also includes the commits C and D, which I do not want to change at all.

Beyond the above example for visualization, the master branch was updated with thousands of commits since the initial feature commit, merged into feature around a dozen times, and feature also has ~500 commits, none of which have been merged into master so far. The commit message changes will have to be performed manually, not just e.g. adding a prefix to each commit.

ietz
  • 73
  • 1
  • 5
  • While `--preserve-merges` will work for this particular (reword only) case, `--rebase-merges` is generally the way to go for all future work. In this particular case, though, I might aim to write a script that uses filter-(branch|repo) to update just the designated commit messages without touching the snapshots. This would require preparing all the replacement messages in advance, putting them into individual files named by the original commit hash ID, for instance. – torek Nov 18 '21 at 05:52

0 Answers0