this post was submitted on 23 Oct 2023
1 points (100.0% liked)

Emacs

312 readers
2 users here now

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

Get Emacs

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

founded 1 year ago
MODERATORS
 

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 comment's thread
view the rest of the comments
[–] noooit@alien.top 1 points 1 year ago

It should error out in a such case and you should rebase your local changes from remote whenever you can, manually fixing the conflicts if they exist.

The only use case for no rebase is when you have a gitconfig not to rebase on pull and you manually want to just pull, which is a quite rare use case.