【问题标题】:rebase conflict issue in branch B分支 B 中的 rebase 冲突问题
【发布时间】:2019-05-24 17:40:42
【问题描述】:

我正在尝试学习变基。 我有一个从开发分支创建的分支 A, 从分支 A 我创建了一个新的本地分支 B。 我使用这个命令 git pull --rebase origin A 做了一个 git rebase

我在做 rebase 时会遇到冲突。在我修改代码之后。 你能告诉我要执行什么命令来消除冲突吗?提供以下状态

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

【问题讨论】:

标签: git github rebase


【解决方案1】:

你需要:

  • 打开 sports/ajax.js
  • 删除合并标记(&lt;&lt;&lt;&lt;====&gt;&gt;&gt;&gt;),选择要保留的内容,
  • git add .(无需提交)
  • git rebase --continue

【讨论】:

  • 嘿,很抱歉回复晚了,你能告诉我这个数字是什么意思吗 1 和 2(branchB|REBASE 1/2)
  • @zizi 它代表“待办事项”列表,其编号是在 Git 2.3 (stackoverflow.com/a/28285323/6309) 中引入的:提交的数量“rebased/to be rebased”
  • 所以在我的情况下,一个提交变基和两个提交尚未变基?
  • @zizi 一个提交解决,一个待应用。
  • 你能帮我解决这个问题吗stackoverflow.com/questions/56383755/…
猜你喜欢
  • 2020-12-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-10-31
  • 2014-11-11
  • 2013-04-28
相关资源
最近更新 更多