jcubic
jcubic

Reputation: 66650

How emacs know that file came from git repository?

I didn't install anything for git and when I open a file from git repository Emacs show Git:<BRANCH NAME> in modeline. How Emacs know that it's git repo? I'm using Emacs 24.3.1.

Upvotes: 1

Views: 187

Answers (1)

Alex Ott
Alex Ott

Reputation: 87329

The vc package calls the vc-git-registered function to check, is the file is registered in git. You can find this function in the vc-git.el module. The module itself is loaded first when you access a file in the directory that belongs to Git by using the code (vc-find-root file ".git") that is specified in the autoload section of the vc-git

Upvotes: 5

Related Questions