How can I get Emacs to revert all unchanged buffers when switching branches in git?

前端 未结 3 783
面向向阳花
面向向阳花 2020-12-23 09:13

Often, when I switch branches in git, if the files are open in emacs, then emacs asks if I want to revert them (as it thinks they\'ve changed on disk) even though the conten

相关标签:
3条回答
  • 2020-12-23 09:51

    Try the revbufs package:

    revbufs.el is a tiny Emacs package that safely reverts your buffers when you have files being edited both in Emacs and via external tools (e.g., code generators such as Jomtool)...

    0 讨论(0)
  • 2020-12-23 09:51

    Perhaps you'd like the global auto-revert mode. Try running global-auto-revert-mode and if you like it you can add (global-auto-revert-mode) to your ~/.emacs file.

    0 讨论(0)
  • 2020-12-23 10:09

    Magit package do this automatically, when you activate magit-ionotify-mode (inotify need emacs 24.4 on linux). Its description you can find here.

    0 讨论(0)
提交回复
热议问题