git Atom 编辑器不会重新加载更改的文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35299663/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:46:44  来源:igfitidea点击:

Atom editor does not reload changed file

gitatom-editorgit-reset

提问by SharpCoder

I am using Atom editor on Windows 7. On the git shell when I run the command, git reset --hard, all the other editors reset/undo all the modified files. but if I am using ATOM editor, changes are retained. If I try to close the file in editor, Atom ask, file is changed, do you want to save the changes.

我在 Windows 7 上使用 Atom 编辑器。在 git shell 上,当我运行命令时git reset --hard,所有其他编辑器都会重置/撤消所有修改过的文件。但如果我使用 ATOM 编辑器,更改将被保留。如果我尝试在编辑器中关闭文件,Atom 会问,文件已更改,是否要保存更改。

How can I force Atom to undo changes when files are modified externally.

在外部修改文件时,如何强制 Atom 撤消更改。

回答by Code-Apprentice

According to https://discuss.atom.io/t/auto-reload-changed-files/8451/6, FileWatcheris an Atom package which will do what you want.

根据https://discuss.atom.io/t/auto-reload-changed-files/8451/6FileWatcher是一个 Atom 包,可以做你想做的事。

回答by Danke Xie

A simple solution that works:

一个简单的解决方案:

1) Just close the file being edited

1) 关闭正在编辑的文件

2) Click "File->Reopen Last Item" to re-open it

2)点击“文件->重新打开最后一项”重新打开它

Bingo!

答对了!

For Atom versions 1.29+, you can just click "Fetch" on the bottom-right corner of the editor.

对于 Atom 1.29+ 版本,您只需单击编辑器右下角的“获取”即可。

enter image description here

enter image description here