0

When I perform a git rebase -i -X theirs and squash all commits except the first, some of the resulting files are different to the most recent version of the file in the branch that I'm rebasing, whereas if I do a plain git rebase -X theirs the files are as I expect them to be.

Can somebody explain to me why this is?

Simon Morgan
  • 2,018
  • 5
  • 23
  • 36
  • Do the commits you are rebasing contain merge commits? – padawin Apr 03 '19 at 09:26
  • @padawin No merge commits. – Simon Morgan Apr 03 '19 at 09:42
  • in the interactive mode, when you mark your commits as being squashed, do you see all your commits, or from here some are missing already? – padawin Apr 03 '19 at 09:55
  • @padawin There are a lot of commits and the branch has had a lot of work over a long period of time but they do seem to all be there. – Simon Morgan Apr 03 '19 at 10:01
  • Not knowing the repository, I'd try narrowing down the issue, squash some commits, check the result, until you find a subset of commits which make it behave like that. Also, do you have a way to create a shareable example reproducing the issue? – padawin Apr 03 '19 at 10:18
  • Also what is the result of: `git rebase ` and `git rebase -i ` (basically without the `-X`)? – padawin Apr 03 '19 at 10:20

0 Answers0