4

How do I jump to the previous/next modification (relative to the git HEAD) in the current file?

Ideally, I like sth like swiper that lets me choose to easily jump between modifications.

2
  • 2
    I currently use git-gutter:next-hunk.
    – HappyFace
    Jun 7, 2021 at 9:34
  • Thanks, that's exactly what I wanted. Oct 2, 2023 at 8:03

1 Answer 1

1

In a file-visiting buffer use C-c f p to visit the last blob that modified it. Once you are in a buffer that visits a blob instead of a file you can use just p and n to move through time.

Note that the C-c f transient prefix (aka "menu") command is only available if you have done (setq magit-define-global-key-bindings 'recommended). Otherwise you have to use the annoying default binding, which is C-c M-g. See that variable for more information.

A "blob" is the version of a file that is stored in a commit. (This is not a precise definition of "blob", but useful in this context.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.