I would be most happy with some kind of emacs hook that would be activated when a file that is under git reposi开发者_如何学Pythontory is visited. But other solutions are welcome as well.
You can try git.el or other alternatives listed here : http://www.emacswiki.org/emacs/Git
you can use function (vc-backend "file-name") from VC package to obtain information about given file. This function returns name of version control system, where this file is registered. To run your own code, you can combine this function with standard find-file-hook
eproject runs a hook when visiting a file contained in a git repository.
精彩评论