0

When I create a Merge Request from Branch A to Branch B, I get the following error:

"Merge failed: Rebase failed. Please rebase locally. Please try again." 

I was able to create the Merge Request successfully before but I this time, I am getting that error.

I am wondering what changes I need to make in Branch A or in git in order to avoid that error.

This is what I have tried:
I have made few more commits in Branch A and tried again but it doesn't resolve the problem

Coder
  • 1
  • 1
  • We need debugging details. Right now there's not enough information to help – evolutionxbox Feb 14 '23 at 16:45
  • On creating a Merge Request from `Branch A` to `Branch B`, I am getting the following error: `"Merge failed: Rebase failed. Please rebase locally. Please try again."` I am wondering what I need to do in order to avoid that problem. When this error usually shows up ? – Coder Feb 14 '23 at 16:47
  • You say _"On creating a Merge Request"_ - Where is this rebase being done? What happens when you try it locally? – evolutionxbox Feb 14 '23 at 16:49
  • I didn't do any rebase. Just simply I was creating a Merge Request from `Branch A` to `Branch B` and I got that error. – Coder Feb 14 '23 at 16:53
  • _"I was creating a Merge Request"_ - how? Where? _"I didn't do any rebase"_ - the error says you are. – evolutionxbox Feb 14 '23 at 17:00
  • Is this on Gitlab? Github? Where? – amphetamachine Feb 14 '23 at 22:13
  • This is on GitLab, not on GitHub. – Coder Feb 15 '23 at 03:41
  • @evolutionxbox I was creating a Merge Request from *Branch A* to *Branch B* in GitLab. When trying to merge, I got that error. Before, I was successfully able to create a MR from *Branch A* to *Branch B* without any problem in GitLab. I am wondering why this time, I got that error. Just wondering. – Coder Feb 15 '23 at 03:48
  • @evolutionxbox Its a new error. I never saw that error while creating a *MR* – Coder Feb 15 '23 at 05:23

1 Answers1

0

git pull --rebase origin BranchB

  • 1
    What this command do ? Does it has any effect on `Branch B`? I don't want to have any effect on `Branch B` because that is not my branch. My branch is `Branch A`. I am creating a `MR` from `Branch A` to `Branch B` – Coder Feb 14 '23 at 16:55
  • The rebase could not be done automatically, as there might be some conflicts,. You need to get the latest changes for branch B and then do a rebase on branch A. This command will not affect branch B in any way. After this command you still need to commit and push in order to do the MR. Here is a answer to what local rebasing is, where instead of branch B you have master. https://stackoverflow.com/questions/7929369/how-to-rebase-local-branch-onto-remote-master – Petrut Marin Feb 15 '23 at 09:45
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 17 '23 at 14:07