How to have PHPstorm automatically monitor / update branch switches when using local terminal?
I prefer to use the mac terminal but found that PHPStorm only really automatically switches branches, when the integrated terminal is opened and has focus.
As soon as I close it, and then do a git checkout features for example, this isn't reliably being picked up by phpstorm.
Is this a known issue, or are there settings somewhere how I can manage this behavior?
Please sign in to leave a comment.
Hello,
Does VCS | Refresh File Status help to pick up the correct branch name?
Are all Synchronization options in Settings | Appearance & Behavior | System Settings enabled?
Hi Vladimir,
I have checked and all these are set, I have created a shortcut to refresh file status but it doesn't help.
Sometimes phpstorm recognized the branch switch immediately, other times only when I focus terminal.
Also I realized, after creating a branch and then committing changes, those changes are also still in phpstorm after I commited the other branch...
So to showcase:
git checkout -b features
mkdir app/Newfeature
touch app/newFeature/Blah.php
git add .
git commit -m "created features branch and added some initial files"
git push origin features
git checkout master
The directory app/Newfeature incl. PHP file are still in my workspace and verified that the toggle at the bottom is on "master" branch.
Why is this happening?!
Even after a restart of phpstorm, those new files are still shown for master. Also verified that when I look in github, those files were only added for the features branch and are not in master.
PhpStorm 2018.1.6
Build #PS-181.5281.35, built on June 14, 2018
Licensed to XXXX
Subscription is active until XXXX
JRE: 1.8.0_152-release-1136-b39 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.6
Now I did a:
git reset --hard
git clean -d -f
And everything is as it's supposed to be, I believe there is something not right with phpstorm ;/
Now after doing the hard reset and clean operation, whenever I switch between the branches the files that only exist in the features branch also disappear when I switch over to master...
I really wonder why this doesn't work right off the bat?
There are few similar issues e.g https://youtrack.jetbrains.com/issue/IDEA-117960
It would be great if you could illustrate the issue with screenshots & "git status" outputs after the branch switches