git - 解决拉入 Atom 的冲突
问题描述
当我拉动并在 Atom 中存在冲突时,将创建带有冲突标记和分离分支的文件。
解决冲突后,我陷入困境。我尝试了“创建分离提交”,但如何继续?当我回到 master 并 push 时,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 中解决这个问题?我没有进一步的想法。
重现步骤:
- 在两个不同的目录 D1 和 D2 中克隆一个新项目
- 创建带有文本“ab”的文本文件
- 在目录 D1 和 D2 中拉取这个
- 在 D2 中将 ""更改
ab
为 "a_b_
" 并使用 'make b cursive' 提交 - 在 D2 中将 " "更改
a_b_
为 "a**_b_**
" 并使用 'make b bold' 提交 - 推送更改
- 在 D1 中将“”更改
ab
为“_a_b
”并使用“制作草书”提交 - 将 D1 中的 " "更改
_a_b
为 "**_a_**b
" 并使用 'make a bold' 提交 - 推送更改
- 因冲突而拉
- 解决冲突,使结果文本为“
**_a_****_b_**
” - 现在我被困在上面的文字中
解决方案
没有变化 - 你忘记使用 'git add' 了吗?
您似乎已经解决了冲突,因此您删除了所有本地编辑。这是你真正的意思吗?如果是这样,那么git rebase --skip
按照它的建议打电话。
编辑:按照您的描述 - 您正在重新设置(?) 2 次提交A1
和A2
,它编辑“a”。
- 首先只是将 cusrive 添加到 a,它会发生冲突。
- (我假设)在那个步骤你编辑它
**_a_****_b_**
,添加并继续变基, - git记录第一次重新提交
A1'
第二次提交也冲突 - (我假设)你再次编辑文件
**_a_****_b_**
并运行git rebase --continue
- 在这里,
file
的内容与 中的相同A1'
,并且您会收到消息“No changes...” - 您可以运行
git rebase --skip
,跳过 A2,因为您的所有更改都已记录在 commit 中A1'
。 - 或者,您可以重新启动 rebase,并将第一次提交仅解析为
_a_**_b_**
,第二次提交为**_a_****_b_**
,以便保留“a”格式的历史记录
推荐阅读
- julia - 在 Flux 中获取神经网络边缘的权重?
- python - 如果每行在一列中有 0,则 Python PandasD 合并具有相等索引的行等于 0,如果任何(或多个)行在一列中有 1,则合并为 1
- kendo-ui - Kendo UI Grid,从 DataItem 获取列索引或名称
- fabricjs - 在fabricjs的文本区域放置标签
- python - 如何使用 w2v 创建单词之间的相似度矩阵
- reactjs - 如何将我当前的反应项目(webapp)转换为移动应用程序?
- node.js - discord js从用户消息中获取参数并在变量中使用它们显示为未定义
- c# - 使用表达式创建 List.Any
- eclipse - 无法使字段私有最终 java.util.Comparator java.util.TreeMap.comarator 可访问:java.base 不会“打开 java.util”到未命名的模块
- ios - 如何使用 react native 自定义键盘