Next: , Previous: , Up: Diffing   [Contents][Index]


5.4.2 Diff Buffer

RET     (magit-diff-visit-file)

From a diff, visit the corresponding file at the appropriate position.

If the diff shows changes in the worktree, the index, or HEAD, then visit the actual file. Otherwise, when the diff is about an older commit or a range, then visit the appropriate blob.

If point is on a removed line, then visit the blob for the first parent of the commit which removed that line, i.e. the last commit where that line still existed. Otherwise visit the blob for the commit whose changes are being shown.

When the file or blob to be displayed is already being displayed in another window of the same frame, then just select that window and adjust point. Otherwise, or with a prefix argument, display the buffer in another window.

User Option: magit-diff-visit-previous-blob

This option controls whether magit-diff-visit-file may visit the previous blob. When this is t 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.

C-<return>     (magit-diff-visit-file-worktree)

From a diff, visit the corresponding file at the appropriate position.

When the file is already being displayed in another window of the same frame, then just select that window and adjust point. With a prefix argument also display in another window.

The actual file in the worktree is visited. The positions in the hunk headers get less useful the "older" the changes are, and as a result, jumping to the appropriate position gets less reliable.

Also see magit-diff-visit-file, which visits the respective blob, unless the diff shows changes in the worktree, the index, or HEAD.

j     (magit-jump-to-diffstat-or-diff)

Jump to the diffstat or diff. When point is on a file inside the diffstat section, then jump to the respective diff section. Otherwise, jump to the diffstat section or a child thereof.

SPC     (scroll-up)

Scroll text upward.

DEL     (scroll-down)

Scroll text downward.


Next: , Previous: , Up: Diffing   [Contents][Index]