Previous: General-Purpose Visit Commands, Up: Visiting Files and Blobs [Contents][Index]
These commands can only be used when point is inside a diff.
magit-diff-visit-file
)This command visits the appropriate version of the file that the diff at point is about.
This commands visits the worktree version of the appropriate file. The location of point inside the diff determines which file is being visited. The visited version depends on what changes the diff is about.
find-file
would visit. In all other
cases visit a "blob" (i.e. the version of a file as stored
in some commit).
In the file-visiting buffer this command goes to the line that corresponds to the line that point is on in the diff.
The buffer is displayed in the selected window. With a prefix argument the buffer is displayed in another window instead.
This option controls whether magit-diff-visit-file
may visit the
previous blob. When this is t
(the default) and point is on a
removed line in a diff for a committed change, then
magit-diff-visit-file
visits the blob from the last revision which
still had that line.
Currently this is only supported for committed changes, for staged
and unstaged changes magit-diff-visit-file
always visits the file in
the working tree.
magit-diff-visit-file-worktree
)This command visits the worktree version of the appropriate file.
The location of point inside the diff determines which file is being
visited. Unlike magit-diff-visit-file
it always visits the "real"
file in the working tree, i.e the "current version" of the file.
In the file-visiting buffer this command goes to the line that corresponds to the line that point is on in the diff. Lines that were added or removed in the working tree, the index and other commits in between are automatically accounted for.
The buffer is displayed in the selected window. With a prefix argument the buffer is displayed in another window instead.
Variants of the above two commands exist that instead visit the file in another window or in another frame. If you prefer such behavior, then you may want to change the above key bindings, but note that the above commands also use another window when invoked with a prefix argument.
Previous: General-Purpose Visit Commands, Up: Visiting Files and Blobs [Contents][Index]