解决合并冲突后 Git rebase 陷入困境

2024-04-25

我正在运行一个遇到冲突的变基:

$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: Better `SelectMotifsView.js`
Using index info to reconstruct a base tree...
M       browser/AddLinkView.js
M       browser/SelectMotifsView.js
M       browser/index.html
Falling back to patching base and 3-way merge...
Auto-merging browser/index.html
CONFLICT (content): Merge conflict in browser/index.html
Failed to merge in the changes.
Patch failed at 0001 Better `SelectMotifsView.js`
The copy of the patch that failed is found in:
   /Users/dmitry/dev/links/.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".

没什么大不了的——我做了一个我知道会引起冲突的小改变:

diff --cc browser/index.html
index ba9c4f3,4c2a1c2..0000000
--- a/browser/index.html
+++ b/browser/index.html
@@@ -40,6 -40,7 +40,10 @@@
              <label>
                  <%= label %>
                  <select class="form-control" name="motif">
++<<<<<<< HEAD
++=======
+                     <% console.log(exclude); %>
++>>>>>>> Better `SelectMotifsView.js`
                      <% motifs.each(function(motif) { if (!exclude || exclude.indexOf(motif) < 0) { %>
                          <option value="<%= motif.get('id') %>"><%= motif.get('name') %></option>
                      <% } }); %>

我想保留该版本HEAD,它是空的,所以我进去并删除整个:

++<<<<<<< HEAD
++=======
+                     <% console.log(exclude); %>
++>>>>>>> Better `SelectMotifsView.js` 

我保存文件,browser/index.html, then git add browser/index.html:

$ git add browser/index.html
$ git rebase --continue

但是之后:

Applying: Better `SelectMotifsView.js`
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this 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".

以前从未见过这个...git status显示没有剩余的未解析路径。该怎么办?我在其他相关问题上读到这可能是一个很好的用途--skip,但这似乎不是空提交。还是我错了?


看起来补丁是空的,所以你可以按照 git 的建议安全地跳过它:

$ git rebase --skip
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

解决合并冲突后 Git rebase 陷入困境 的相关文章

随机推荐

  • 如何使用unix“find”命令查找所有cpp和h文件?

    我知道要找到所有 h我需要使用的文件 find name h 但如何找到所有 h AND cpp files find name h print o name cpp print or find name h o name cpp prin
  • 应该是 WebAPI 还是 asmx

    我应该为我的两个简单 API 使用 ASMX 服务还是 ASP NET Web API 我想在我的 ASP NET MVC 项目中创建两个简单的 API 一个接受 3 个参数 currentUserID DataType ActionNam
  • C# 中的类型与强类型

    在 C 中 有什么理由说强类型与只是typed 当有人说类型化类时 我想到的是对象以外的某种类型 除了 object 之外 几乎所有内容都是用 C 编写的 一旦定义了一个不是对象的类 该类就是一种类型 不再从那里输入它 顺便说一句 这不是关
  • 为什么两个字符串文字相加不使用operator+?

    编辑 我已经重新格式化了帖子以使其更加清晰 为什么这有效 struct A struct B B A void operator const B const B int main A a1 a2 a1 a2 而这不 struct B B c
  • 排序数组中的最小成本路径

    给定一个排序数组A e g 4 9 10 11 19 搬家费用i gt j is abs A j A i 从给定元素开始 例如10 找出成本最低的路径 而无需两次访问同一元素 所以在这个例子中解决方案是10 gt 9 gt 4 gt 11
  • 将图像裁剪或遮罩成圆形

    使用 ImageMagick 或 GD 库将图像裁剪或遮罩成圆形形状的最佳方法是什么 请注意 解决方案存在于 其他 问答网站上 但不存在于 StackOverflow 上 这是使用 ImageMagick 的一种方法 无需使用遮罩即可实现此
  • Python 中的归一化互相关

    最近几天我一直在努力计算两对向量 x和y 的自由度 参考Chelton 1983 它是 根据 Chelton 1983 的自由度 https i stack imgur com O0DqE png 我找不到使用 np correlate 计
  • 像随机关卡生成一样自由流动,只有一种可能的解决方案?

    我已经实现了在这个问题中标记为正确答案的算法 流畅类游戏随机关卡制作用什么 https stackoverflow com questions 12926111 what to use for flow free like game ran
  • 在 Uvicorn/FastAPI 内发出下游 Https 请求的正确方法是什么?

    我有一个 API 端点 FastAPI Uvicorn 除此之外 它还向另一个 API 请求信息 当我使用多个并发请求加载 API 时 我开始收到以下错误 h11 util LocalProtocolError can t handle e
  • 如何在创建后将 VB.NET DataTable 列定义为主键

    我正在使用 VB NET dataAdapter 从 Oracle 数据库导入表 我使用 fill 命令将导入的数据添加到数据集中 在 DataTable 已填充数据后 如何将 DataTable 的特定列定义为 PrimaryKey 只要
  • 灵活地将新数据附加到 yaml 文件

    我有不同的 yaml 文件 它们可能具有不同的嵌套结构 文件1 yaml test3 service1 name1 somedata name2 somedata 文件2 yaml test1 app1 app2 somedata app7
  • 在远程服务器上执行 rake 任务

    生产环境的物理架构包括多台执行不同作业 rake 任务 的机器 所有这些机器都在同一个数据库上 其中一项工作将完成大量工作UPDATE如果其他作业正在运行 则通常会返回 postgres 死锁的表 我已经有一个 rake 任务来正常停止其他
  • 如何对字符串进行拼写检查?

    有人知道 C 多语言拼写检查库吗 我不需要实时拼写检查 仅检查字符串 thanks 就其价值而言 这是谷歌上的第一个点击 SpellCheck http msdn microsoft com en us library system win
  • 如何在本地闭包中调用非逃逸闭包? [复制]

    这个问题在这里已经有答案了 我有一个看起来像这样的函数 func test closure gt let localClosure closure localClosure 这只是一个例子 并不能完全反映我遇到的问题 显然在这里我可以直接打
  • 类型错误:“str”对象无法使用 input() 调用[重复]

    这个问题在这里已经有答案了 我有以下代码 它应该询问用户 2 文件名 我在第二个函数中的 input 中遇到错误 但在第一个函数中没有 我不明白 这是错误 输出 getOutputFile 文件 splitRAW py 第 22 行 位于
  • Keras:嵌入 LSTM

    在 LSTM 的 keras 示例中 用于对 IMDB 序列数据进行建模 https github com fchollet keras blob master examples imdb lstm py https github com
  • Azure 静态 Web 应用程序和 Azure Blob 存储静态网站有什么区别?

    有什么区别Azure Blob 存储静态网站 https learn microsoft com en us azure storage blobs storage blob static website host and Azure 静态
  • Spring boot 启动慢

    这是一个奇怪的问题 我们正在使用带有集成 tomcat 的 Spring Boot Web 应用程序 在我的本地 Mac 上 应用程序启动很快 几秒钟 在装有 Centos 7 的 google 机器上 启动速度非常慢 大约 2 分钟 应用
  • Swiftlint 覆盖与 SPM 相关的项目设置

    我遇到了 swiftlint 自动更正的奇怪行为 我的项目使用通过 SPM 导入的库 但是当我运行 linter 时 它会更改如下设置 B4621A7323D0A90F00545ADE LibraryName in Frameworks i
  • 解决合并冲突后 Git rebase 陷入困境

    我正在运行一个遇到冲突的变基 git rebase master First rewinding head to replay your work on top of it Applying Better SelectMotifsView