PhpStorm and git: how hide files not commited during checkout?

Hi to all,

I'm using PHPStorm 2018.3.4.

My current git work method is following:

  • master: in-production branch, tagged
  • development: branch from wich I checkout a feature-somefeature branch and where I merge the feature after all tests went OK.

So, for example, my work is

git checkout -b feature-adduser
[...] hard work with TDD
git add . && git commit -m "Add feature Adduser"
git push --set-upstream origin feature-adduser

On github (because I have travis and scrutinizer and codecov perform their auto checks) I merge the feature-adduser branch into develop. After merging, in local...

git checkout development
git pull --no-ff
git checkout -b feature-newfeature
[...] hard work
git add . && git commit -m "Implements new feature"

And so on.

In reality, using PHPStorm I right-click on files and click on "commit" directly, after that in terminal I launch the git push[...] command.

Now, I want to learn a can-be-possible scenario.

I'm in feature-addfeature branch (only on local, at the moment). I edited and added IPTest.php under Tests.

My boss calls me and I need to place a hotfix.

In theory, I would

git checkout development
git pull --no-ff
git checkout -b hotfix-cannotlogin
[...]hard work
git push --set-upstream origin hotfix-cannotlogin

and merge with github.

The issue that I have, I did stage the modified/added files under feature-addfeature (via VCS > Git > Stage files) or via git add ., but, when I switch branch from feature-addfeature to develop, I have visible the new files and the edited file. Is it normal? Is there a mode to hide them? Am I wrong with use of stage?

Sorry for long explain.


when I switch branch from feature-addfeature to develop, I have visible the new files and the edited file. Is it normal?

It is, the files are still there in the file system, so it'd be weird if we didn't show them.

What you can do here is to use tasks, they have a context (the list if open tabs), a changelist and a branch associated with them.

  1. Create a task for the new feature associating a branch/context/changelist with it.
  2. When you need to apply a hot-fix, either create a new task, or use the 'general development' task created previously.

When you switch between tasks, the only place you'll see those files would be the file tree.


No worries. Is it anything remotely close to what you were asking for?


Please sign in to leave a comment.