"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.

4
13 comments

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

9
Avatar
Permanently deleted user

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...

3
Avatar
Permanently deleted user

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

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

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

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
Avatar
Permanently deleted user

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

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

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

 

0

I'm having same issue

0

No way! in 2023 we still have this bug!

0

I had a conflict with the dev branch
I rebase dev to my local branch

then merge my remote branch to local branch then merge dev branch to my local branch. And it helped

0

Jetbrains' IDE might be having some sort of bug on this, but there might be a way to avoid the trouble alltogether. 
I faced this bug, because I was merging branch A into branch B, and my linters have been triggered on pre-commit, and have failed. But, likely, noone needs linters in such situation. Pls google ‘stop pre-commit on merge commit’ to understand it better. The solution could be like this, for those who use Husky v4-: https://stackoverflow.com/a/64586174.  
For Husky v5+, just update the ‘.husky/pre-commit’ file in a  similar way.

0

Please sign in to leave a comment.