1

I am trying to learn rebase. I have a branch A which is created from develop branch, from the branch A I created a new local branch B. i did a git rebase using this command git pull --rebase origin A

I am facing conflicts when I do rebase. after I modify the code. Can you let me know what command to execute to remove the conflicts. Providing the status below

sports/code/file (branchB)
$ git pull --rebase origin branchA
From https://gitlab.sports.com
 * branch            branchA -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: wip html fixes
Using index info to reconstruct a base tree...
M       sports/ajax.js
Falling back to patching base and 3-way merge...
Auto-merging sports/ajax.js
CONFLICT (content): Merge conflict in sports/ajax.js
error: Failed to merge in the changes.
Patch failed at 0001 wip html fixes
The copy of the patch that failed is found in: .git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".



sports/code/file (branchB|REBASE 1/2)
$ git status
rebase in progress; onto 89898989892323
You are currently rebasing branch 'branchB' on '89898989892323'.
  (fix conflicts and then run "git rebase --continue")
  (use "git rebase --skip" to skip this patch)
  (use "git rebase --abort" to check out the original branch)

Unmerged paths:
  (use "git reset HEAD <file>..." to unstage)
  (use "git add <file>..." to mark resolution)

        both modified:   sports/ajax.js

no changes added to commit (use "git add" and/or "git commit -a")
  • Possible duplicate of [How to resolve merge conflicts in Git](https://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-in-git) – phd May 25 '19 at 12:01
  • https://stackoverflow.com/search?q=%5Bgit%5D+resolve+conflicts – phd May 25 '19 at 12:01

1 Answers1

1

You need to:

  • open sports/ajax.js
  • remove the merge markers (<<<<, ====, >>>>), choosing what you want to keep,
  • git add . (no commit needed)
  • git rebase --continue
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • hey sorry for late response can you let me know what does this number means 1 and 2`(branchB|REBASE 1/2)` –  May 29 '19 at 14:17
  • @zizi it represents the "todo" list, whose numbers were introduced in Git 2.3 (https://stackoverflow.com/a/28285323/6309): the number of commits "rebased/to be rebased" – VonC May 29 '19 at 15:20
  • so in my case one commit rebase and two commits yet to be rebased? –  May 29 '19 at 19:18
  • 1
    @zizi One commit to resolve, one still to be applied. – VonC May 30 '19 at 03:16
  • can you help me with this one https://stackoverflow.com/questions/56383755/routing-inside-code-sandbox-failing-due-to-withrouter –  May 30 '19 at 18:29
  • hey can you help with this one too https://stackoverflow.com/questions/56385656/react-app-local-storage-is-not-setting-up –  May 31 '19 at 14:01
  • hey can you help me with a data structure problem https://stackoverflow.com/questions/56532668/graph-data-structure-in-node-js –  Jun 10 '19 at 19:49