We have a setup with two repositories, dev repository and deploy repository (can't change that) with rebase-only merge strategy. Initially dev repo looked like this:
main: A -> B -> C -> D
|______| |______|
release: Sq1 -> Sq2
So main would have full linear history, and release contained squashed commits and will be rebased onto deploy repo's main. release also might have deploy-only commits, which would be rebased back from deploy, but will not be rebased onto main:
At some point squashing was removed, and only rebasing was done:
main: A -> B -> C -> D -> E -> F
|______| |______|
release: Sq1 -> Sq2 -> E* -> F*
So current situation:
[dev]
main: only dev commits
release: old squashed commits, new commits from main + some external commits not in main
[deploy]
main: almost like release in dev, but can contain some more external commits
Now, the problem is this: every time we rebase main onto release we need to manually skip all old main commits which were already merged but with squash. We don't want to be doing that.
My idea is to rebase them all into release but remove all changes - so that the git in the future will see that those commits were merged and will skip them automatically, leaving only new commits in the rebase. But I'm not sure how to do that. Also if there is a better way to solve this, I would be glad to hear that!
rerereto remember skipping the commits?rerere, looks handy.