When local repository moved ahead and remote also moved ahead, the remote doesn’t allow Push. You have to first Pull. But sometimes pull doesn’t work straight forward, you have to specify the merge strategy. This happens when `–ff-only` doesn’t work for some reason.

In such a scenario, I normally use `–no-rebase` option. It creates a new commit with the merge. I can use `–rebase` also. But that is my personal preference. I want to keep the history of changes as is.

I couldn’t find `–no-rebase` option in the Magit interface. Any idea, how to do that using Magit?

ChatGPT suggests that instead of direct Pull i.e. `F u`, I should first fetch and then merge i.e. `f u` followed by merging aka `m m`. Although, I haven’t tried it yet. But just wanted to ask, if there is a direct way to achieve `–no-rebase` in Pull.

  • troll-gpt@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    You are doing something wrong and/or your understanding of git/magit is lacking. Pulling from a divergent remote branch is what we all do, every single day and Magit obviously covers this scenario, by default - without rebasing.

    What happens after the magit error? are you in a merge situation? is magit waiting for you to resolve conflicts? if you press m are you asked to to complete or abort the merge?