we are working on a git repo with several branches. The system only allows to deploy changes onto the live system, if all commits have feature-ids as the beginning of the commit comment that must be approved by the company for this project.
We have a typo in one commit that is more than 100 commits back in the past (several people working on this repo), that leads to the feature-id being wrong (and therefore not approved for this project). So now we are not able to push our changes into the live system because of this one commit.
Therefore I need to change the commit message of this one commit to solve my problem.
I researched and came across this solution using git rebase
. I'm aware of the fact that I would change git history here and I'm aware of the implications. That would be fine so far. Now my problem is that (to my understanding), git rebase takes all the ~140 commits, deletes them from the history and tries to apply them again. This works well if you don't have any merges in your commits.
But boy do we have a lot of merges. There were many merge conflicts, that have all been resolved (obviously).
But when the rebase is done, the information on how to resolve the conflicts seems to be lost and git asks me to merge everything again. That is not a viable option because re-doing merges for ~140 commits would take about four weeks or more (also information on how to merge might not be available any more).
So we need to make git resolve these conflicts automatically, using the information given in the repo.
I can't figure out how to do that. I read about the git rerere
command (see here), but to my understanding I should have enabled that option before resolving all the conflicts and while doing so, git would have recorded the necessary information for later.
What are my options to get this one commit renamed? Seems like a simple tasks, but I'm out of ideas.
Thanks a lot for any help!