如何使VSCode强制重新加载已更改的文件? [英] How to make VSCode to forcefully reload a changed file?

查看:237
本文介绍了如何使VSCode强制重新加载已更改的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了VSCode的问题,由于退出另一个分支,它不想加载更改的文件.我不在乎VSCode对当前文件的看法,如果磁盘上的文件发生更改甚至更好,我希望它重新加载,它会识别分支已更改并重新加载该文件.

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.

推荐答案

您可以尝试使用(实验性的)文件查看器.也许必须有一些错误,但是您可以很好地执行代码->首选项->设置->文件->检查实验文件观察器.另外,不要忘记忽略不需要的文件(例如,以Reactjs-node_modules为例)

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)

这篇关于如何使VSCode强制重新加载已更改的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆