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.

You are viewing a single thread.
View all comments
1 point

I avoid the need to do this by always keeping my local changes in a branch. Then I can pull master from the remote without any merging, rebase my branch, then merge the branch back into master in a fast forward. Keeps a clean stack of commits without any merges in the history.

permalink
report
reply

Emacs

!emacs@communick.news

Create post

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

  • Windows
  • Mac OS X
  • GNU/Linux and BSD (Just get it from your distribution’s package manager)

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for “emacs” and “vi” link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

Community stats

  • 6

    Monthly active users

  • 564

    Posts

  • 2.4K

    Comments