Let me start by briefly describing our setup. We have a "master" GitHub repo to which we can only contribute via pull requests. We also have a private fork on GitHub where all the work happens, and from where we actually create pull requests. Finally, there's a local clone of that private fork.
The task at hand is to rewrite a multitude of commit messages, and obviously git filter-branch
is the tool of choice here.
I've created a temporary branch in my local cloned repo and successfully did all the filtering there - which apparently created an "alternative history" with all the commits affected by the filter. Then, as described in https://stackoverflow.com/a/15256575, I've rebased the local master onto the temporary branch.
Now the question is - what would be the safest way to:
- Update the GitHub fork so that the other people on the team are unaffected (we can coordinate necessary activities so this update does not happen unexpectedly). I suppose
git push --force-with-lease
could be the way to go, however I've never tried it in conjunction withfilter-branch
so I am not at all sure if that's a good idea. - Propagate the changes to the master repo via a pull request
Thanks!