Next: Commands Available in Diffs, Up: Diffing [Contents][Index]
The transient prefix command magit-diff-refresh
, on D
, can be used to
change the diff arguments used in the current buffer, without changing
which diff is shown. This works in dedicated diff buffers, but also
in the status buffer.
(There is one exception; diff arguments cannot be changed in buffers
created by magit-merge-preview
because the underlying Git command does
not support these arguments.)
magit-diff-refresh
) ¶This transient prefix command binds the following suffix commands along with the appropriate infix arguments and displays them in a temporary buffer until a suffix is invoked.
magit-diff-refresh
) ¶This suffix command sets the local diff arguments for the current buffer.
magit-diff-set-default-arguments
) ¶This suffix command sets the default diff arguments for buffers of the same type as that of the current buffer. Other existing buffers of the same type are not affected because their local values have already been initialized.
magit-diff-save-default-arguments
) ¶This suffix command sets the default diff arguments for buffers of the same type as that of the current buffer, and saves the value for future sessions. Other existing buffers of the same type are not affected because their local values have already been initialized.
magit-diff-toggle-refine-hunk
) ¶This command toggles hunk refinement on or off.
magit-diff-switch-range-type
) ¶This command converts the diff range type from "revA..revB" to "revB…revA", or vice versa.
magit-diff-flip-revs
) ¶This command swaps revisions in the diff range from "revA..revB" to "revB..revA", or vice versa.
magit-diff-toggle-file-filter
) ¶This command toggles the file restriction of the diffs in the current buffer, allowing you to quickly switch between viewing all the changes in the commit and the restricted subset. As a special case, when this command is called from a log buffer, it toggles the file restriction in the repository’s revision buffer, which is useful when you display a revision from a log buffer that is restricted to a file or files.
In addition to the above transient, which allows changing any of the supported arguments, there also exist some commands that change only a particular argument.
magit-diff-less-context
) ¶This command decreases the context for diff hunks by COUNT lines.
magit-diff-more-context
) ¶This command increases the context for diff hunks by COUNT lines.
magit-diff-default-context
) ¶This command resets the context for diff hunks to the default height.
The following commands quickly change what diff is being displayed without having to using one of the diff transient.
magit-diff-while-committing
) ¶While committing, this command shows the changes that are about to be committed. While amending, invoking the command again toggles between showing just the new changes or all the changes that will be committed.
This binding is available in the diff buffer as well as the commit message buffer.
magit-go-backward
) ¶This command moves backward in current buffer’s history.
magit-go-forward
) ¶This command moves forward in current buffer’s history.
Next: Commands Available in Diffs, Up: Diffing [Contents][Index]