On occasion, the git information on mode-line, gets stuck and will not update. For example if I checkout to a different branch, the old branch will still be shown. Or the "mod" indicator will remain when it should not.
Anyone know how to fix this?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityThis information is being updated by the VC package that is part of Emacs.
Many users have noticed that this information isn't always being updated when it should and asked about that problem in many different places, or reported as a bug in some unrelated package/project such as Magit or Spacemacs.
Because this has been reported as a Magit bug or feature request so often, I have added a note about it to Magit's FAQ: The mode-line information isn’t always up-to-date. Also see https://github.com/magit/magit/issues/2687.
I just realized that this relevant page on the wiki isn't being mentioned in the FAQ entry. You might want to check that out too.
Check the manual about version control info in the mode line, specifically the part about auto-revert-check-vc-info
.
If you set
auto-revert-check-vc-info
tot
, Auto Revert mode updates the version control status information everyauto-revert-interval
seconds, even if the work file itself is unchanged. The resulting CPU usage depends on the version control system, but is usually not excessive.
You probably just want (setq auto-revert-check-vc-info t)
in your .emacs or something like that.