解决Atom中的拉力冲突

时间:2018-05-01 18:54:18

标签: git atom-editor

当我拉动Atom时发生冲突时,会创建带有冲突标记和分离分支的文件。

解决冲突后,我陷入困境。我尝试过“创建分离提交”,但是如何继续?当我回到掌握并推送git仍然说我当前分支的尖端是在远程后面。当我拉,它说

It seems that there is already a rebase-apply directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
    git rebase (--continue | --abort | --skip)
If that is not the case, please
    rm -fr "C:/Users/ststolz/git/test/.git/rebase-apply"
and run me again.  I am stopping in case you still have something
valuable there.

当我现在在命令行中尝试git rebase --continue时,git说:

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

我还尝试将分离的分支重新绑定为master。在这里,我也得到了“似乎......”的信息。在分离的分支上执行git rebase --continue时,我再次得到“没有变化 - 你......”。

我应该如何在Atom中解决这个问题?我没有进一步的想法。

重现的步骤:

  1. 在两个不同的目录D1和D2
  2. 中克隆一个新项目
  3. 使用文字“ab”
  4. 创建文本文件
  5. 在目录D1和D2中拉出
  6. 在D2中将“ab”更改为“a_b_”并使用“make b cursive”进行提交
  7. 在D2中将“a_b_”更改为“a**_b_**”并使用“make b bold”提交
  8. 推送更改
  9. 在D1中将“ab”更改为“_a_b”并使用“制作草书”进行提交
  10. 在D1中将“_a_b”更改为“**_a_**b”并使用“make a bold”提交
  11. 推送更改
  12. 因冲突而拉
  13. 解决冲突,以便生成的文字为“**_a_****_b_**
  14. 现在我被困在上面的文字

1 个答案:

答案 0 :(得分:1)

  

没有变化 - 您是否忘记使用'git add'?

您好像已经解决了冲突,因此您删除了所有本地修改。这是你真正的意思吗?如果是,请按照建议调用git rebase --skip

修改:按照您的说明进行操作 - 您正在重新定位(?)2次提交A1A2,它们会编辑“a”。

  • 首先只是将cusrive添加到a,它就会发生冲突。
  • (我假设)在该步骤中您将其编辑为**_a_****_b_**,添加并继续 变基,
  • git记录第一次重新提交的提交A1'第二次提交也发生冲突
  • (我假设)您再次将文件编辑为**_a_****_b_**并运行git rebase --continue
  • 此处,file的内容与A1'中的内容相同,您会收到消息“无更改...”
  • 您可以运行git rebase --skip,跳过A2,因为所有更改都已记录在提交A1'中。
  • 或者,您可以重新启动rebase,并将第一次提交仅解析为_a_**_b_**,将第二次提交解析为**_a_****_b_**,以便保留“a”格式的历史记录
相关问题