Alex Rivera | Logout

How can I tell Emacs my git branch has changed?

Asked 2013-06-11T18:07:54.010
13

At the bottom of my Emacs 23 editor, I notice that Emacs is aware that I am working in a directory that is under version control, what that version control system is, and what branch I am currently on. Pretty cool! But say I am on the master branch, and from the command line I do a git commit, followed by a git checkout <branch>. Emacs still shows me being on the master branch. How do I refresh Emacs so that it reflects the branch I am currently on without closing down all my buffers and restarting it?

Edit
Report

1 Answer

10

You can revert buffer automatically by enable global-auto-revert-mode. If you want to enable it, please add following code to your configuration file.

(global-auto-revert-mode 1)
(setq auto-revert-check-vc-info t)
answered 2013-06-12T01:02:30.353

Your Answer