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-somefeaturebranch 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 README.md 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.
Please sign in to leave a comment.
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.
When you switch between tasks, the only place you'll see those files would be the file tree.
https://www.jetbrains.com/help/phpstorm/managing-tasks-and-context.html
Thank you for the moment!
No worries. Is it anything remotely close to what you were asking for?