When trying to switch git branches, I lose all of my settings
If I have WebStorm open with my project, go to PowerShell to do a git branch switch, but receive an error about my changes need to be committed before proceeding, when I come back to WebStorm, it gives me an error message, and I lose the majority of my settings. When I say majority, I'm talking things like what beautifiers I had turned on, items I added to the Content Root, etc. I do not lose my editor settings like spaces instead of tabs, etc. I wanted to start a thread to see if there was an issue already like this out there... if not, I will try and add the error message that WebStorm throws, but I'm not sure it'll be very helpful.
Just to reiterate, this happens when git throws an error in PowerShell. On a normal branch switch without the git error message, everything is fine, and I don't lose my settings.
Please sign in to leave a comment.
I'm not sure what the issue has to do with WebStorm... You are running Git in your system terminal, outside of WebStorm, and face some issues that result in losing project files (settings you have mentioned are normally stored in the project `.idea` folder). Can't see what can be done on IDE end to fix this...
Why wouldn't I lose my settings on changing to any branch then? My settings are not saved in the git repo... they are saved outside of it. So basically what I'm saying is, WebStorm shouldn't freak out and lose my settings if changing to a different branch fails. This is a WebStorm monitoring the git branch issue.
> This is a WebStorm monitoring the git branch issue.
Are you using WebStorm Git integration, or perform all Git actions externally, outside of WebStorm? Do you have your project .idea files version controlled?
I perform the majority of the operations outside of WS. It does look like someone checked in the .idea dir in that project, yes. I'm going to try and remove that from git to see if it helps any. It still wouldn't explain why those settings get wiped out... if the branch doesn't actually change because of an error on switching, the settings shouldn't be lost.
If the Git integration is not used, and Git commands are run externally, then all WebStorm does is reading files from disk. Looks as if the files on disk get removed/corrupted/replaced as a result of your actions, and this is not a thing IDE can be blamed for
Interesting, so you're saying if I performed all of my actions from the IDE then I shouldn't see this issue? I'll have to try that at some point... but first, let me try removing the .idea from version control and see if that helps.
I have a vaguely similar issue. I use an external terminal and after switching branches when I double click on a file to open it, content is put on the screen but there is a notice to say that `File has changed on disk .... Reload`. I have to remember to use that every time I see it because otherwise I end up saving content from different branches. It is as though intellij has some other version of the file floating around, even when I have closed all open files.
my .idea directory is NOT part of the repo.
MacOs Mojave
Well, intellij does have the local versioning that it keeps track of, so I'm wondering if that's what's going on for you. As for my issue, it's been fixed by removing the .idea dir from my repo. Are you sure there aren't any lingering .idea or related dirs/sub-dirs that are still part of your repo?