Windows 10, Emacs 25.1, Magit
I want auto refresh buffer "magit-status" when was some change on files in my project.
So I set variable magit-refresh-status-buffer
to on non nil
. But it not help.
You shouldn't have to set magit-refresh-status-buffer
to a non-nil value because the default value already is t
. (Magit only refreshes after Emacs changed a file (i.e. on save-buffer
) and after it ran git
for side-effects.)
It sounds like you want the status buffer to be automatically refreshed when something outside of Emacs changes a file. Magit's refresh machinery does not support that - you will have to explicitly refresh using g.
It would theoretically be possible to watch for changes and then automatically refresh the status buffer, but that would affect performance and could lead to race conditions. There actually exists a package that implements this, magit-filenotify
, but I recommend against using it because it has the issues mentioned earlier and also because it wasn't updated in two years.
To automatically refresh the status buffer whenever you visit a file-visiting buffer use:
(add-hook 'after-save-hook 'magit-after-save-refresh-status t)
magit-emacs-Q-command
magit.vc/manual/magit/Debugging-Tools.html.
M-x magit-emacs-Q-command
. As result in minibuffer: Uncustomized Magit command saved to kill-ring, please run it in a terminal.
Commented
Oct 8, 2017 at 13:22