Difference between revisions of "Magit"

From WikEmacs
Jump to: navigation, search
(Change magit diff colors)
m (move content to Git page)
 
(2 intermediate revisions by one user not shown)
Line 39: Line 39:
  
 
  (setq magit-completing-read-function 'magit-ido-completing-read)
 
  (setq magit-completing-read-function 'magit-ido-completing-read)
 +
 +
== Extensions ==
 +
 +
=== magit-filenotify: refresh status buffer when git tree changes ===
 +
 +
This module, to be installed with [[ELPA]], comes with a minor mode '''magit-filenotify''' which tracks
 +
changes in the source tree using '''file-notify''' and refreshes the magit
 +
status buffer.  Emacs 24.4 with `file-notify-support' is required for it to
 +
work.
 +
 +
home and documentation: https://github.com/magit/magit-filenotify
 +
  
 
== See Also ==
 
== See Also ==

Latest revision as of 08:50, 10 April 2014

Magit
Description Git integration for Emacs
Author Phil Jackson
Maintainer Phil Jackson
Source https://github.com/magit/magit

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

Basic setup[edit]

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

Helpful keybindings[edit]

  • 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[edit]

Change magit diff colors[edit]

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

(eval-after-load 'magit
   '(progn
    (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"))))

Use ido to checkout branches[edit]

(setq magit-completing-read-function 'magit-ido-completing-read)

Extensions[edit]

magit-filenotify: refresh status buffer when git tree changes[edit]

This module, to be installed with ELPA, comes with a minor mode magit-filenotify which tracks changes in the source tree using file-notify and refreshes the magit status buffer. Emacs 24.4 with `file-notify-support' is required for it to work.

home and documentation: https://github.com/magit/magit-filenotify


See Also[edit]

Project Pages[edit]