重新设置分支B中的冲突问题 [英] rebase conflict issue in branch B

查看:90
本文介绍了重新设置分支B中的冲突问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习变基. 我有一个从develop分支创建的分支A, 我从分支A创建了一个新的本地分支B. 我使用此命令进行了git rebase git pull --rebase origin A

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")

推荐答案

您需要:

  • open sports/ajax.js
  • 删除合并标记(<<<<====>>>>),选择要保留的内容,
  • git add .(无需提交)
  • git rebase --continue
  • open sports/ajax.js
  • remove the merge markers (<<<<, ====, >>>>), choosing what you want to keep,
  • git add . (no commit needed)
  • git rebase --continue

这篇关于重新设置分支B中的冲突问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆