"Couldn't check the working tree for unmerged files because of an error"

Answered

This is my second failed attempt to merge a branch into another and I don't even know what's wrong. After successfully resolving all conflicts, the Event Log showed this message:

 

9:27 Couldn't check the working tree for unmerged files because of an error.
error: Committing is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: Exiting because of an unresolved conflict.
during executing git "C:\Program Files\Git\bin\git.exe" -c core.quotepath=false commit -F C:\Users\MyUser\PycharmProjects\dogpatchsports_com\.git\MERGE_MSG --

 

And the branch is blocked in a "Merging branch" state. I have aboslutely no idea what is going on or how to solve it. I'd appreciate some help.

10 comments
Comment actions Permalink

have the same problem - also no clue how to solve this. every conflict was already resolved by me via popup before. still says that files have unresolved conflicts...

1
Comment actions Permalink

Check git status in console. Maybe some files were deleted incorrectly (in one branch moved, in other deleted and etc)

8
Comment actions Permalink

thanks for the tip.
i checked with git status.
some files were deleted in one branch, moved in another, as you suspected.
had to use git rm on all those files. then git status showed no conflicts anymore and i could commit.
unfortunately the git integration in the intellij products doesn't show this...

2
Comment actions Permalink

Same problem. `git pull/commit/push` works in command line, but not in PhpStorm integration.

 

Also when i try to commit files it ask for git user.name / user.email, but after insert it can't save changes. it seems like PhpStorm can't acceess to .git directory or /usr/bin/git

 

PhpStorm 2020.2.3
Build #PS-202.7660.42, built on October 16, 2020

 

UPD: MacOs restart saved the day

1
Comment actions Permalink

if someonse has the same bug: if webstorm doesn't show the right git status with gui (which is strange), use cli and git status   

0
Comment actions Permalink

OMG! in 2021 we still have this bug!

The winner is Mister Postmodern!

You simply run the `git status` and git cli explains how to deal with each file.

For example

Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: packages/ui-components/src/GeoMapLeaflet/GeoMapLeaflet.stories.tsx

Please Jet Brains, fix it.

1
Comment actions Permalink

Hi,

I have the same problem when using git on windows through the linux subsystem (WSL)

My project being in the /home/user/www/project on subsystem, I had mounted a network drive to the subsystem (U:\ to \\wsl$\Ubuntu-20.04). I then opened my project, which located to U:\home\user\www\project.

But it seems to be buggy for Phpstorm. I opened my project directly through the \\wsl$\Ubuntu-20.04\home\user\www\project network and it works.

 

 

1
Comment actions Permalink

Dynasdaq
There is a bug report about the issue, please feel free to vote:
https://youtrack.jetbrains.com/issue/IDEA-162058

 

0
Comment actions Permalink

I'm having same issue

0
Comment actions Permalink

hi, same error, wire in console git status, below show the errors with the solutions, no is a jetbrains error is a errir in merge

1

Please sign in to leave a comment.