git - 分支 B 中的 rebase 冲突问题
问题描述
我正在尝试学习变基。我有一个从开发分支创建的分支 A,从分支 AI 创建了一个新的本地分支 B。我使用这个命令 git pull --rebase origin A 做了一个 git 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")
解决方案
你需要:
- 打开体育/ajax.js
- 删除合并标记(
<<<<
,====
,>>>>
),选择要保留的内容, git add .
(无需提交)git rebase --continue
推荐阅读
- python - 安装emscripten需要什么版本的python?
- intellij-idea - 无法使用 gradle 将 YAML 添加到 Intellij
- dynamics-crm - 访问/导出 CRM 365 审计日志数据
- javascript - 如何缓存文本区域?
- javascript - 使用同一组件中的方法在 Vue 组件中查找特定数据时遇到问题
- ignite - Apache Ignite 瘦客户端事件
- python - 为什么 Sentry 推荐的 Django 日志记录配置使来自 django.db.backends 的日志记录静音?
- javascript - js如何在屏幕上移动动画
- php - Mysql将数据插入double类型
- python - 我想知道如何在 Python 中计算两种 numpy 数组类型的相似度(数值精度)