Let's say I have several consecutive commits, we name them A0..A99
for simplicity, pushed by the same author to the main
branch: these commits are not the last commits pushed to the main
branch as other commits were pushed on top of those by other authors.
I wish to alter the main
branch history such as A0..A99
commits are condensed into one single commit, hence, from A0..A99
to just A
, essentially similar to a git squash and merge if these commits were to be squashed and merged on top of my main
branch, but with the added complexity that all commits and changes pushed after A0..A99
still need to be preserved.
The intent is to cleanup the branch history as these A0..A99
commits were supposed to be squashed and merged, but they were just all merged to the main
branch.
As an additional factor to consider, this Git repository is hosted on GitHub and we use GitHub Releases, meaning that each release/tag is associated to the commit hash it was created from, therefore I need to make sure this doesn't break my existing releases or at least find a way to fix them in the event that commit hashes are regenerated: not sure that is actually the case, just considering the possibility and the impact it would have on my releases in GitHub.
Anyhow, it is safe to assume that no release was ever done in between commits A0..A99
.
How can I do that?
Thanks.