1

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!

2
  • 1
    What about using rerere to remember skipping the commits? Commented Oct 3, 2023 at 11:17
  • @choroba I will have to test it out, but that does seem to be one approach, making the process easier. I wonder though if we can get rid of skips completely... Thanks for the suggestions, first time I see rerere, looks handy. Commented Oct 4, 2023 at 14:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.