Git rollback and file watcher
Hello all,
I have a question about file watchers and git rollback. I have made a file watcher based on php-cs-fixer and it works perfectly when coding.
But everytime I'm trying to use git rollback, file watcher is executed and I can't get back the git version of a file without runing file watcher on it.
Is there a way to disable the automatic file watcher on git rollbacks ?
Edit : I'm using PhpStorm 2020.3.2 on MacOS
Please sign in to leave a comment.
It could be an offtop question but nonetheless, is there any specific reason why would you prefer using PHP-CS-Fixer with File Watcher instead of using the built-it IDE capability?
(https://www.jetbrains.com/help/phpstorm/using-php-cs-fixer.html)
Hi Vasiliy,
The reason I'm using a file watcher is that I would like to use cs-fixer everytime I save a file and not using it manualy in `Code > Inspect Code...`.
Maybe I'm doing something wrong or I missed something from the doc you linked
Hey Nicolas,
Thanks, I got the point. No, there is no option to automatically fix file on save.
Back to the original question, did you try disabling the "Trigger the watcher on external changes" File Watcher advanced option? I have just tried it in a test environment and it seems to be, does the trick with Git rollback.
It works like a charm, thank you !
Fantastic, thank you for the confirmation and have a nice Friday!