简体   繁体   English

使用 Intellij/Git 将 master 合并到我的功能分支时遇到问题

[英]Trouble merging master to my feature branch using Intellij/Git

My procedure:我的程序:

  1. In my feature branch I commit and push all my changes.在我的功能分支中,我提交并推送所有更改。
  2. Using Intellij, I select origin/master -> merge into current.使用 Intellij,我选择 origin/master -> 合并到当前。
  3. The conflicting files are presented to me.冲突的文件呈现给我。 I solve the conflicts in all files.我解决了所有文件中的冲突。

I get the following error:我收到以下错误:

Couldn't check the working tree for unmerged files because of an error.由于错误,无法检查未合并文件的工作树。 Committing is not possible because you have unmerged files.提交是不可能的,因为您有未合并的文件。

What am I missing?我错过了什么?

Thank you for your help.感谢您的帮助。

Although you may have resolved the conflicts in the files after the merge, Git does not actually know this.尽管您可能在合并后解决了文件中的冲突,但 Git 实际上并不知道这一点。 Instead, it still sees the files in conflict.相反,它仍然看到冲突的文件。 To resolve this, you need to git add each file which was in conflict to mark it as resolved.要解决此问题,您需要git add每个冲突的文件以将其标记为已解决。

If you right click each file in conflict in IntelliJ, there should be a menu item for adding to version control.如果在 IntelliJ 中右键单击每个冲突的文件,应该有一个用于添加到版本控制的菜单项。 You may also use the Project menu on the top to do this.您也可以使用顶部的“项目”菜单来执行此操作。

Once you have added each file, Git should report that all conflicts have been resolved, and you may commit the merge.添加完每个文件后,Git 应该报告所有冲突都已解决,您可以提交合并。

For my IntelliJ, if I resolve conflicts in it, it does add the files automatically.对于我的 IntelliJ,如果我解决了其中的冲突,它会自动添加文件。 For your case, go to the console/terminal run git status to check if all files are green, if not do git add .对于您的情况,请转到控制台/终端运行git status检查所有文件是否为绿色,如果不是则执行git add .

暂无
暂无

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

相关问题 Git:是否将master合并到master上的功能分支和REBASING功能分支上? - Git: Are MERGING master into feature branch and REBASING feature branch on master equivalent? Git:将大型主分支与功能分支合并 - Git: Merging very large master branch with a feature branch Git Merging Branch成Master - Git Merging Branch Into Master 正确的方法来清理Git功能分支而不合并到master中? - Proper way to clean up a Git feature branch without merging it into master? 在变基到 Git 中的 Master 之前与另一个功能分支合并 - Merging with another feature branch before rebasing to Master in Git 为什么将主分支合并到功能分支会从 GIT 中的功能分支中删除文件? - Why merging master branch to feature branch is deleting files from feature branch in GIT? 使用gitflow删除'feature'分支而不合并到master分支 - delete a 'feature' branch using gitflow without merging into master branch 合并 Master 分支、修复冲突、从合并中删除其他文件后,GIT 将我的功能分支中的文件视为最新文件 - After merging Master branch, fixing conflicts, removing other files from the merge, GIT is treating files in my feature branch as latest 使用git扩展如何在不更改功能分支的情况下将我的功能分支合并到主分支中? - Using git extension how do I merge my feature branch into the master branch without changing my feature branch? 使用git将主分支合并到开发分支时出错 - Getting error while merging master branch into development branch using git
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM