Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make VSCode to forcefully reload a changed file?

I am having an issue with VSCode where it does not want to load changed file due to checking out a different branch. I do not care what VSCode thinks about the current file, I would like it to reload if a file changed on the disk or even better, it recognizes that the branch has changed and it reloads the file.

I can see that it may want to keep the file if the file has some unsaved changes, but that is not what I care. I would like it to reload it given that I am changing a branch on the file system.

I do not know what this feature might be called, but the only way I found was to revert the file, although I am not reverting it.

like image 591
yarun can Avatar asked Jan 10 '19 04:01

yarun can


2 Answers

If you prefer a one-time manual action, you can use File -> Revert (or CTRL+SHIFT+P revert file).

like image 111
xtofl Avatar answered Oct 29 '22 11:10

xtofl


You can try the (experimental) file watcher. There must be some bugs maybe, but you can well do Code -> Preferences -> Settings -> File -> Check Experimental File watcher. Also, dont forget to ignore files where you don't need this to happen.(As Reactjs-node_modules, for example)

like image 43
Mohamed Anees A Avatar answered Oct 29 '22 11:10

Mohamed Anees A