Next: Wip Modes, Previous: Worktree, Up: Miscellaneous [Contents][Index]
These are some of the commands that can be used in all buffers whose
major-modes derive from magit-mode
. There are other common commands
beside the ones below, but these didn’t fit well anywhere else.
magit-copy-section-value
)This command saves the value of the current section to the
kill-ring
, and, provided that the current section is a commit,
branch, or tag section, it also pushes the (referenced) revision to
the magit-revision-stack
.
When the current section is a branch or a tag, and a prefix argument
is used, then it saves the revision at its tip to the kill-ring
instead of the reference name.
magit-copy-buffer-revision
)This command saves the revision being displayed in the current buffer
to the kill-ring
and also pushes it to the magit-revision-stack
. It
is mainly intended for use in magit-revision-mode
buffers, the only
buffers where it is always unambiguous exactly which revision should
be saved.
Most other Magit buffers usually show more than one revision, in some way or another, so this command has to select one of them, and that choice might not always be the one you think would have been the best pick.
Outside of Magit M-w
and C-w
are usually bound to kill-ring-save
and
kill-region
, and these commands would also be useful in Magit buffers.
Therefore when the region is active, then both of these commands
behave like kill-ring-save
instead of as described above.