Can't upgrade from Yii 2.0.6 to latest version

I’m trying to upgrade my Yii version 2.0.6 to latest version via composer but I keep getting this error:

Updating yiisoft/yii2 (2.0.6 => Update failed (Failed to execute git status --porcelain --untracked-files=no fatal: Unknown index entry format db560000

Would you like to try reinstalling the package instead [yes]?

I type yes and it removes my yii2 completely

See image:

All the dependencies are updated and working, it’s just yii that is not upgrading.

I tried to upgrade from 2.0.6 to 2.0.7 but the same thing. I have this in my composer.json:

"require": {

"yiisoft/yii2": ">=2.0.7"


Any clue?

It’s fixed. I had to go to:

/vendor/yiisoft/yii2/.git folder, delete index and do a git reset