Skip to main content

Magit User Manual

Magit is an interface to the version control system Git, implemented as an Emacs package. Magit aspires to be a complete Git porcelain. While we cannot (yet) claim that Magit wraps and improves upon each and every Git command, it is complete enough to allow even experienced Git users to perform almost all of their daily version control tasks directly from within Emacs. While many fine Git clients exist, only Magit and Git itself deserve to be called porcelains.

This manual is for Magit version 3.3.0.

Copyright (C) 2015-2021 Jonas Bernoulli ﹤jonas@bernoul.li﹥

You can redistribute this document and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

• Introduction:  
• Installation:  
• Getting Started:  
• Interface Concepts:  
• Inspecting:  
• Manipulating:  
• Transferring:  
• Miscellaneous:  
• Customizing:  
• Plumbing:  
• FAQ:  
• Debugging Tools:  
• Keystroke Index:  
• Command Index:  
• Function Index:  
• Variable Index:  

|

                                                                                                                                                           |    |    |

| — The Detailed Node Listing — Installation
| | | | • Installing from Melpa: |    | | | • Installing from the Git Repository: |    | | | • Post-Installation Tasks: |    | | | Interface Concepts
| | | | • Modes and Buffers: |    | | | • Sections: |    | | | • Transient Commands: |    | | | • Transient Arguments and Buffer Variables: |    | | | • Completion, Confirmation and the Selection: |    | | | • Running Git: |    | | | Modes and Buffers
| | | | • Switching Buffers: |    | | | • Naming Buffers: |    | | | • Quitting Windows: |    | | | • Automatic Refreshing of Magit Buffers: |    | | | • Automatic Saving of File-Visiting Buffers: |    | | | • Automatic Reverting of File-Visiting Buffers: |    | | | Sections
| | | | • Section Movement: |    | | | • Section Visibility: |    | | | • Section Hooks: |    | | | • Section Types and Values: |    | | | • Section Options: |    | | | Completion, Confirmation and the Selection
| | | | • Action Confirmation: |    | | | • Completion and Confirmation: |    | | | • The Selection: |    | | | • The hunk-internal region: |    | | | • Support for Completion Frameworks: |    | | | • Additional Completion Options: |    | | | Running Git
| | | | • Viewing Git Output: |    | | | • Git Process Status: |    | | | • Running Git Manually: |    | | | • Git Executable: |    | | | • Global Git Arguments: |    | | | Inspecting
| | | | • Status Buffer: |    | | | • Repository List: |    | | | • Logging: |    | | | • Diffing: |    | | | • Ediffing: |    | | | • References Buffer: |    | | | • Bisecting: |    | | | • Visiting Files and Blobs: |    | | | • Blaming: |    | | | Status Buffer
| | | | • Status Sections: |    | | | • Status Header Sections: |    | | | • Status Module Sections: |    | | | • Status Options: |    | | | Logging
| | | | • Refreshing Logs: |    | | | • Log Buffer: |    | | | • Log Margin: |    | | | • Select from Log: |    | | | • Reflog: |    | | | • Cherries: |    | | | Diffing
| | | | • Refreshing Diffs: |    | | | • Commands Available in Diffs: |    | | | • Diff Options: |    | | | • Revision Buffer: |    | | | References Buffer
| | | | • References Sections: |    | | | Visiting Files and Blobs
| | | | • General-Purpose Visit Commands: |    | | | • Visiting Files and Blobs from a Diff: |    | | | Manipulating
| | | | • Creating Repository: |    | | | • Cloning Repository: |    | | | • Staging and Unstaging: |    | | | • Applying: |    | | | • Committing: |    | | | • Branching: |    | | | • Merging: |    | | | • Resolving Conflicts: |    | | | • Rebasing: |    | | | • Cherry Picking: |    | | | • Resetting: |    | | | • Stashing: |    | | | Staging and Unstaging
| | | | • Staging from File-Visiting Buffers: |    | | | Committing
| | | | • Initiating a Commit: |    | | | • Editing Commit Messages: |    | | | Branching
| | | | • The Two Remotes: |    | | | • Branch Commands: |    | | | • Branch Git Variables: |    | | | • Auxiliary Branch Commands: |    | | | Rebasing
| | | | • Editing Rebase Sequences: |    | | | • Information About In-Progress Rebase: |    | | | Cherry Picking
| | | | • Reverting: |    | | | Transferring
| | | | • Remotes: |    | | | • Fetching: |    | | | • Pulling: |    | | | • Pushing: |    | | | • Plain Patches: |    | | | • Maildir Patches: |    | | | Remotes
| | | | • Remote Commands: |    | | | • Remote Git Variables: |    | | | Miscellaneous
| | | | • Tagging: |    | | | • Notes: |    | | | • Submodules: |    | | | • Subtree: |    | | | • Worktree: |    | | | • Bundle: |    | | | • Common Commands: |    | | | • Wip Modes: |    | | | • Commands for Buffers Visiting Files: |    | | | • Minor Mode for Buffers Visiting Blobs: |    | | | Submodules
| | | | • Listing Submodules: |    | | | • Submodule Transient: |    | | | Wip Modes
| | | | • Wip Graph: |    | | | • Legacy Wip Modes: |    | | | Customizing
| | | | • Per-Repository Configuration: |    | | | • Essential Settings: |    | | | Essential Settings
| | | | • Safety: |    | | | • Performance: |    | | | • Default Bindings: |    | | | Plumbing
| | | | • Calling Git: |    | | | • Section Plumbing: |    | | | • Refreshing Buffers: |    | | | • Conventions: |    | | | Calling Git
| | | | • Getting a Value from Git: |    | | | • Calling Git for Effect: |    | | | Section Plumbing
| | | | • Creating Sections: |    | | | • Section Selection: |    | | | • Matching Sections: |    | | | Conventions
| | | | • Theming Faces: |    | | | FAQ
| | | | • FAQ - How to …?: |    | | | • FAQ - Issues and Errors: |    | | | FAQ - How to …?
| | | | • How to pronounce Magit?: |    | | | • How to show git's output?: |    | | | • How to install the gitman info manual?: |    | | | • How to show diffs for gpg-encrypted files?: |    | | | • How does branching and pushing work?: |    | | | • Can Magit be used as ediff-version-control-package?: |    | | | • Should I disable VC?: |    | | | FAQ - Issues and Errors
| | | | • Magit is slow: |    | | | • I changed several thousand files at once and now Magit is unusable: |    | | | • I am having problems committing: |    | | | • I am using MS Windows and cannot push with Magit: |    | | | • I am using OS X and SOMETHING works in shell, but not in Magit: |    | | | • Expanding a file to show the diff causes it to disappear: |    | | | • Point is wrong in the COMMIT_EDITMSG buffer: |    | | | • The mode-line information isn't always up-to-date: |    | | | • A branch and tag sharing the same name breaks SOMETHING: |    | | | • My Git hooks work on the command-line but not inside Magit: |    | | | • git-commit-mode isn't used when committing from the command-line: |    | | | • Point ends up inside invisible text when jumping to a file-visiting buffer: |    | | | • I am unable to stage when using Tramp from MS Windows: |    | | | • I am no longer able to save popup defaults: |    | | |

                                                                                                                                                          |    |    |