Unchecked file in non-active changelist gets committed to Git anyway

I have changes in docker-compose.yml that aren't ready yet so I've moved the file to a separate changelist. Meanwhile, I want to commit some of the changes in another file. I ensure that other file is in the active changelist and I select the exact blocks I want to save. I also double-check that docker-compose.yml isn't selected.

Before hitting Commit, I also check that the pane displays "1 modified":

Then I press Commit. However, every time, docker-compose.yml disappears from the Commit side pane and when I check git logs I realise the file has been committed too and I need to revert it from the command line:

git reset --soft HEAD^
git restore --staged docker-compose.yml

I'm very new to Git. I understand Changelists are a PhpStorm feature. Am I doing something wrong?

Edit: I've changed project settings to enable Git's staging area. Although both PhpStorm and git status confirm that docker-compose.yml will not be committed, it'll always be. What's going on here?

0

You can ignore this. A colleague had added this line to .hooks/pre-commit.sh for whatever the reason:

git add "docker-compose.yml"
0

请先登录再写评论。