From WikEmacs
Revision as of 09:58, 16 January 2014 by Elvince (talk | contribs) (Common Customization)
Jump to: navigation, search
Description Git integration for Emacs
Author Phil Jackson
Maintainer Phil Jackson

Magit is an Emacs mode for working with Git repositories. It provides a convenient interface for the most common Git operations.

Basic setup

(add-to-list 'load-path "/path/to/magit/directory")
(require 'magit)

Helpful keybindings

  • M-x magit-status is the main entry point to Magit. The author recommends binding this command to "a key of your choice". [C-x g] is a common choice:
(global-set-key (kbd "C-x g") 'magit-status)

The official Magit documentation is excellent and should be consulted for further information.

Common Customization

Change magit diff colors

If you want more common colors (green and red), instead of psyche highlighting:

(eval-after-load 'magit
    (set-face-foreground 'magit-diff-add "green3")
    (set-face-foreground 'magit-diff-del "red3")
    (when (not window-system)
      (set-face-background 'magit-item-highlight "black"))))

See Also

Project Pages