git 如何结束文件的合并?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2113050/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 07:41:37  来源:igfitidea点击:

How to conclude your merge of a file?

gitmerge

提问by Muaz Al-Jarhi

After I merged a file in Git I tried to pull the repository but error came up:

在 Git 中合并文件后,我尝试拉取存储库,但出现错误:

You have not concluded your merge. (MERGE_HEAD exists)

您尚未完成合并。(MERGE_HEAD 存在)

How does one conclude a merge?

如何完成合并?

回答by MBO

Check status (git status) of your repository. Every unmerged file (after you resolve conficts by yourself) should be added (git add), and if there is no unmerged file you should git commit

检查git status存储库的状态 ( )。每个未合并的文件(在您自己解决冲突后)都应该添加 ( git add),如果没有未合并的文件,您应该git commit

回答by VonC

Note and update:

注意和更新:

Since Git1.7.4(January 2011), you have git merge --abort, synonymous to "git reset --merge" when a merge is in progress.

Git1.7.4(2011 年 1 月)开始,当合并正在进行时,您有git merge --abort,与“ git reset --merge”同义。

But if you want to complete the merge, while somehow nothing remains to be added, then a crude rm -rf .git/MERGE*can be enough for Git to forget about the current merge.

但是,如果您想完成合并,而不知何故还没有添加任何内容,那么粗略的rm -rf .git/MERGE*就足以让 Git 忘记当前的合并。

回答by user3127648

The easiest solution I found for this:

我为此找到的最简单的解决方案:

git commit -m "fixing merge conflicts"
git push

回答by Cebu CM Solutions

If you encounter this error in SourceTree, go to Actions>Resolve Conflicts>Restart Merge.

如果在 SourceTree 中遇到此错误,请转到操作>解决冲突>重新启动合并。

SourceTree version used is 1.6.14.0

使用的 SourceTree 版本是 1.6.14.0

回答by Nirju

I had the same error and i did followed article found on google solves my issue. You have not concluded your merge

我有同样的错误,我确实按照在谷歌上找到的文章解决了我的问题。 您尚未完成合并