简体   繁体   English

在 git 将一个分支合并到另一个已经与另一个分支合并的分支时遇到问题...致命错误或 MERGE_MSG

[英]Having troubl in git merging a branch into another branch that has already been merged with another branch... fatal error or MERGE_MSG

Just to put it out there, I'm completely green at coding and at GIT. In the assessment I'm doing I have to create three branches apart from the master.只是为了把它放在那里,我在编码和 GIT 上完全是绿色的。在我所做的评估中,我必须创建三个分支,除了主人。 I create and checkout one branch called "drawings" and add and commit it (this branch is a subdirectory [with the eponymous name "drawings"] with three jpgs moved into it).我创建并签出一个名为“drawings”的分支,然后添加并提交它(该分支是一个子目录 [同名名称“drawings”],其中移入了三个 jpg 文件)。 Then I go back to master and then create and checkout a second branch called "pictures" and add commit it (a subdirectory named pictures with two jpgs in it).然后我 go 回到 master,然后创建并签出第二个名为“pictures”的分支并添加提交(一个名为 pictures 的子目录,其中有两个 jpg)。 I add and commit this.我添加并提交这个。 Then I checkout master and then create and checkout a branch called "together".然后我签出 master 然后创建并签出一个名为“together”的分支。 Here is where the trouble starts.这是麻烦开始的地方。

I use git merge drawings After that, I'm supposed to merge "together" with "pictures".我使用git merge drawings之后,我应该将“一起”与“图片”合并。 What I do is我做的是

git checkout together

then然后

git merge picture

it takes me to a MERGE_MSG screen.它会将我带到 MERGE_MSG 屏幕。 I have no clue what to do in there or how you exit it.我不知道在那里做什么或如何退出它。 I'm on Windows 10 and I'm using the Ubuntu Terminal.我在 Windows 10 上,正在使用 Ubuntu 终端。

Even if I close the terminal and reopen and get back to the master branch, I get fatal errors no matter what command I use even it is "git log" or "git status".即使我关闭终端并重新打开并返回主分支,无论我使用什么命令,即使它是“git log”或“git status”,我都会收到致命错误。

Any help would be greatly appreciated and if you need screenshots of anything, let me know.任何帮助将不胜感激,如果您需要任何内容的屏幕截图,请告诉我。

On the first merge, there was no real merge, git fast-forwarded .在第一次合并时,没有真正的合并,git fast-forwarded进。 The second merge does require a real merge and so it tries, succeeds and then you go into an editor where you will set up a comment for the revsion.第二次合并确实需要真正的合并,因此它会尝试并成功,然后您 go 进入编辑器,您将在其中为修订设置注释。 So you should write whatever comment you want, save and exit.所以你应该写任何你想要的评论,保存并退出。 If it's nano, the options are at the bottom... if it's vi/vim, it's a little more complex... check any guide on how to use vi to write something, save and exit.如果是 nano,选项在底部...如果是 vi/vim,则稍微复杂一些...查看有关如何使用 vi 编写内容、保存和退出的任何指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM