Reputation: 5704
I love the JetBrains IDEs - I've used IntelliJ and more recently PHPStorm very happily for a couple years now. Unfortunately since our team moved to Git I've experienced a problem with the autosave feature that's meant I've had to switch to the comparatively rubbish Eclipse instead.
Basically what happens is that if I have any files open in PHPStorm when I do a Git pull, the IDE fails to update the currently open file with the new version I'd just pulled, doesn't warn me of the difference, and pretty soon saves over the newly pulled file with the old version.
This has led to colleagues losing their work on a few occasions.
It's easy to forget to close your files in the IDE before you do a pull or a checkout, and the overwrite can happen very easily because PHPStorm saves whenever you leave the editing window. You can't turn off the autosave.
I am hating Eclipse and wishing there was some way I could safely return to PHPStorm's fantastic set of features. Has anyone else experienced this problem? Are you using a JetBrains IDE happily with Git? Is there some setting I can use?
I think this may be related to the bug discussed on the JetBrains tracker here http://youtrack.jetbrains.com/issue/IDEA-89247. Shame such a great IDE is sabotaged by this behaviour!
Upvotes: 0
Views: 933
Reputation: 5704
I've found you can turn off PHPStorm's autosave function in IDE Settings > General - you deselect "save files on frame activation" and "save files automatically if application idle". After some months of working like this I've never had another file overwritten. I do miss the handy autosave, and I get occasional annoying memory/file system difference warnings, but I'm delighted I can continue to use my favourite IDE.
One other new thing I do is synchronise a directory manually whenever I do a pull into it. I couldn't find any explanation of what "synchronise" was when I was starting out - for the benefit of other nitwits it basically synchronises the files in the PHPStorm file view with any changes that might've happened on the file system.
Upvotes: 2
Reputation: 401887
It may be caused by symlinks or some other configuration that breaks native file system notifications (provided by fsnotifier
binary bundled with IntelliJ IDEA based products).
You can try the new EAP version and see if it works there. If not, file a bug.
As a workaround it's possible to delete fsnotifier
and IDEA will use Java polling methods to detect external changes (more reliable, but slower).
Upvotes: 0