Previous: Visiting Blobs, Up: Inspecting [Contents][Index]
Also see the git-blame(1) manpage.
To start blaming you can use M-x
in a file-visiting buffer to invoke
one of the following commands. You can also invoke these commands
using the blame popup, which is available on b
in file-visiting
buffers that already contain blame information and, also on b
, in all
blob-visiting buffers. You can also enter the blame popup from the
file popup, which is available on C-c M-g
, provided magit-file-mode
is enabled, see Minor Mode for Buffers Visiting Files.
This command augments each line or chunk of lines in the current file- or blob-visiting buffer with information about what commits last touched these lines.
If the buffer visits a revision of that file, then history up to that revision is considered. Otherwise, the file’s full history is considered, including uncommitted changes.
If Magit-Blame mode is already turned on in the current buffer then
blaming is done recursively, by visiting REVISION:FILE (using
magit-find-file
), where REVISION is a parent of the revision that
added the current line or chunk of lines.
This command is like magit-blame
except that it doesn’t turn on
read-only-mode
and that it initially uses the visualization style
specified by option magit-blame-echo-style
.
This command augments each line or chunk of lines in the current blob-visiting buffer with information about the revision that removes it. It cannot be used in file-visiting buffers.
Like magit-blame
, this command can be used recursively.
This command augments each line or chunk of lines in the current file- or blob-visiting buffer with information about the last revision in which a line still existed.
Like magit-blame
, this command can be used recursively.
The following key bindings are available when Magit-Blame mode is enabled and Read-Only mode is not enabled. These commands are also available in other buffers; here only the behavior is described that is relevant in file-visiting buffers that are being blamed.
magit-show-commit
)This command shows the commit that last touched the line at point.
magit-diff-show-or-scroll-up
)This command updates the commit buffer.
This either shows the commit that last touched the line at point in the appropriate buffer, or if that buffer is already being displayed in the current frame and if that buffer contains information about that commit, then the buffer is scrolled up instead.
magit-diff-show-or-scroll-down
)This command updates the commit buffer.
This either shows the commit that last touched the line at point in the appropriate buffer, or if that buffer is already being displayed in the current frame and if that buffer contains information about that commit, then the buffer is scrolled down instead.
The following key bindings are available when Magit-Blame mode is enabled and Read-Only mode is not enabled.
magit-blame-popup
)This prefix command shows the above suffix command along with the appropriate infix arguments in a popup buffer.
magit-blame-next-chunk
)This command moves to the next chunk.
magit-blame-next-chunk-same-commit
)This command moves to the next chunk from the same commit.
magit-blame-previous-chunk
)This command moves to the previous chunk.
magit-blame-previous-chunk-same-commit
)This command moves to the previous chunk from the same commit.
magit-blame-quit
)This command turns off Magit-Blame mode. If the buffer was created during a recursive blame, then it also kills the buffer.
magit-blame-copy-hash
)This command saves the hash of the current chunk’s commit to the kill ring.
When the region is active, the command saves the region’s content
instead of the hash, like kill-ring-save
would.
magit-blame-cycle-style
)This command changes how blame information is visualized in the
current buffer by cycling through the styles specified using the
option magit-blame-styles
.
Blaming is also controlled using the following options.
This option defines a list of styles used to visualize blame information. For now see its doc-string to learn more.
This option specifies the blame visualization style used by the
command magit-blame-echo
. This must be a symbol that is used as the
identifier for one of the styles defined in magit-blame-styles
.
This option specifies the format string used to display times when showing blame information.
This option controls whether blaming a buffer also makes temporarily read-only.
This option lists incompatible minor-modes that should be disabled temporarily when a buffer contains blame information. They are enabled again when the buffer no longer shows blame information.
This hook is run when moving between chunks.
Previous: Visiting Blobs, Up: Inspecting [Contents][Index]