These commands read any existing Magit buffer that belongs to the current repository from the user and then switch to the selected buffer (without refreshing it).
The last variant uses
magit-display-buffer to do so and thus respects
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.
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
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.
When the region is active, this command saves that to the
kill-ring-save would, instead of behaving as described above. If a prefix argument is used and the region is within a hunk, then it strips the diff marker column and keeps only either the added or removed lines, depending on the sign of the prefix argument.
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
C-w are usually bound to
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.