Next: , Previous: , Up: Miscellaneous   [Contents][Index]


8.7 Minor Mode for Buffers Visiting Files

The magit-file-mode enables certain Magit features in file-visiting buffers belonging to a Git repository. It should be enabled globally using global-magit-file-mode. Currently this mode only establishes a few key bindings, but this might be extended in the future.

User Option: magit-file-mode

Whether to establish certain Magit key bindings in all file-visiting buffers belonging to a Git repository. This establishes the bindings suggested in Getting Started (but only for file-visiting buffers), and additionally binds C-c M-g to magit-file-popup.

C-c M-g     (magit-file-popup)

This prefix command shows a popup buffer featuring suffix commands that operate on the file being visited in the current buffer.

C-c M-g s     (magit-stage-file)

Stage all changes to the file being visited in the current buffer.

C-c M-g u     (magit-unstage-file)

Unstage all changes to the file being visited in the current buffer.

C-c M-g c     (magit-commit-popup)

This prefix command shows suffix commands along with the appropriate infix arguments in a popup buffer. See Initiating a Commit.

C-c M-g D     (magit-diff-buffer-file-popup)

This prefix command shows the same suffix commands and infix arguments in a popup buffer as magit-diff-popup. But this variant has to be called from a file-visiting buffer and the visited file is automatically used in the popup to limit the diff to that file.

C-c M-g d     (magit-diff-buffer-file)

This command shows the diff for the file of blob that the current buffer visits.

User Option: magit-diff-buffer-file-locked

This option controls whether magit-diff-buffer-file uses a decicated buffer. See Modes and Buffers.

C-c M-g L     (magit-log-buffer-file-popup)

This prefix command shows the same suffix commands and infix arguments in a popup buffer as magit-log-popup. But this variant has to be called from a file-visiting buffer and the visited file is automatically used in the popup to limit the log to that file.

C-c M-g l     (magit-log-buffer-file)

This command shows the log for the file of blob that the current buffer visits. Renames are followed when a prefix argument is used or when --follow is part of magit-log-arguments. When the region is active, the log is restricted to the selected line range.

User Option: magit-log-buffer-file-locked

This option controls whether magit-log-buffer-file uses a decicated buffer. See Modes and Buffers.

C-c M-g b     (magit-blame-popup)

This prefix command shows the magit-blame suffix command along with the appropriate infix arguments in a popup buffer. See Initiating a Commit.

C-c M-g p     (magit-blob-previous)

Visit the previous blob which modified the current file.


Next: , Previous: , Up: Miscellaneous   [Contents][Index]