1

I want to use this git command

git rebase -X theirs --onto new-repo --committer-date-is-author-date commit_id master

but this error occurs

fatal: cannot combine apply options with merge options

Can someone explain this to me?

(Git Version 2.26.2.windows.1 on Windows 10)

  • The version of Git you are using (and ideally, your OS) would be great info for people that would want to help you ;) – philb Jan 25 '23 at 19:50
  • @philb Oh, I'm sorry, I'm new to stackoverflow, I forgot to add that information. I'm using Git version 2.26.2.windows.1 on Windows 10 – MobxLimited Jan 26 '23 at 15:08

2 Answers2

1

First, make sure to upgrade to the latest Git for Windows (2.39.1)

The actual error message would now read:

apply options and merge options cannot be used together

In your case:

  • -X<option> is a merge strategy, involving the rebase "merge backend"
  • --onto is an apply option, , involving the rebase "apply backend"

Since you cannot have both backend for the same rebase operation, you get that error message.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

In my case the issue was previously unfinished apply operation.

This is what helped me to resolve it:

rm -r ".git/rebase-apply"
tomrozb
  • 25,773
  • 31
  • 101
  • 122