30.1.12.10 Auto-Reverting Buffers That Visit Tracked Files

When Emacs executes VCS operations that it knows may change the contents of tracked files, it reverts buffers visiting those files (see Reverting a Buffer). It does this in a VCS-aware fashion that retains the positions of point and the mark even when the VCS operation causes VCS keywords to be expanded (see Inserting Version Control Headers).

An important limitation of this feature is that Emacs won’t know to revert buffers when you execute additional VCS operations outside of Emacs, such as at a shell prompt, or by means of scripts. If you regularly do this, and you don’t use a VCS with keyword expansion (all modern VCS, absent special configuration), you may wish to enable vc-auto-revert-mode instead, by customizing that variable to a non-nil value.

This mode is just like global-auto-revert-mode (see Auto Revert: Keeping buffers automatically up-to-date) except limited to files visiting VCS-tracked files. It ensures that Emacs will always revert buffers when VCS operations change their contents, regardless of whether Emacs initiated those operations.

See Version Control and the Mode Line, for details regarding Auto Revert mode in buffers visiting tracked files (which is what vc-auto-revert-mode enables).