Consider the following problem:
- Private Project containing some credentials in the early stages
- We want to go open source
- We need to get rid of the credentials in the history
- credentials are not in single files but in code
- Complicated history with several merges, pull requests etc.
What I want to do:
Squash all commits from root up to an arbitrary commit with clean state to one big 'Initial commit'.
When I do:
git rebase -i --root
And squash the first commits together:
pick Initial commit \
fixup dirty1 |
fixup dirty2 | Squash these to one, to remove credentials.
fixup dirty3 |
fixup clean1 /
pick clean2
pick clean3
...
...
I have to rebase everything and resolve all merge conflicts again after that.
How can I just squash the first N commits without having to resolve the entire history including the merge conflicts after the N + 1 commit.