Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在合并后撤消git合并。重命名限制警告加冲突_Git_Version Control_Git Merge - Fatal编程技术网

在合并后撤消git合并。重命名限制警告加冲突

在合并后撤消git合并。重命名限制警告加冲突,git,version-control,git-merge,Git,Version Control,Git Merge,我正在尝试将一个devel分支合并到master中 stefanos-imac:trunk borini$ git merge --squash devel CONFLICT (content): Merge conflict in test1 warning: inexact rename detection was skipped due to too many files. warning: you may want to set your merge.renamelimit variab

我正在尝试将一个devel分支合并到master中

stefanos-imac:trunk borini$ git merge --squash devel
CONFLICT (content): Merge conflict in test1
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 2224 and retry the command.
Squash commit -- not updating HEAD
Automatic merge failed; fix conflicts and then commit the result.
很公平

stefanos-imac:trunk borini$ git config merge.renameLimit 999999
然后,我尝试撤消合并,并使用更高的限制重新进行合并

stefanos-imac:trunk borini$ git merge --abort
fatal: There is no merge to abort (MERGE_HEAD missing).
好吧,也许我必须照它说的做,然后重新调用merge命令

stefanos-imac:trunk borini$ git merge --squash devel
fatal: 'merge' is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>' as
appropriate to mark resolution and make a commit, or use 'git commit -a'.
stefanos-imac:trunk-borini$git-merge-squash-devel
致命:“合并”不可能,因为您有未合并的文件。
请在工作树中修复它们,然后使用'git add/rm'作为
适用于标记解析并进行提交,或使用“git commit-a”。
哦,吉特,你为什么是这样一个吉特

更重要的是,有人知道如何摆脱这种局面吗

Em,
git reset--硬源/主

git merge--中止
也会起作用。比键入完整的git reset命令快一点


Abort也适用于
重基
樱桃拾取

撤消合并的现代方法是(但这仅在存在合并头时有效):

还有一种稍旧的方法,在这种情况下可以使用(缺少MERGE_HEAD):

已接受答案中描述的老式方式(警告:将放弃所有本地更改):

因此请注意,
git merge--abort
仅相当于
git reset--merge
,前提是存在
merge\u HEAD
。这可以在git-help for-merge命令中读取

git merge --abort is equivalent to git reset --merge when MERGE_HEAD is present.

在失败的合并之后,当没有
merge\u HEAD
时,可以使用
git reset--merge
撤消失败的合并,但不一定要使用
git merge--abort

这一特殊情况清楚地表明merge--abort失败了,我自己也看到了这一点。看到中止失败总是很难过:(git reset--merge,这对我来说很有效,因为所描述的merge_头丢失了。
git reset --merge
git reset --hard
git merge --abort is equivalent to git reset --merge when MERGE_HEAD is present.