1

When using M-x magit-checkout, I can only select a branch. Is it possible to visit a commit (the stage at the commit) using Magit? Thanks!

2

From the magit log buffer (l l (lowercase L twice)), go on the desired commit with the point (cursor) and if you press b b (checkout branch/revision) the commit at point will be proposed for checkout. Otherwise with enter on the commit you will see the content of the commit without checkout into it.

7
  • Thanks, i go on the desired commit, but when pressing bb, it offers me to checkout only branches, no commits. however, I can enter them myself typing on the minibuffer. Is this normal behaviour? Feb 1 at 19:37
  • 1
    If I am on a commit with the point and I press b b, magit proposes the SHA of the commit at point in the list of the possible targets. E.g the echo area says: Checkout (default 228f9fb): (228f9fb is the SHA hash of the commit at point).
    – Marioba
    Feb 1 at 19:59
  • If I am on a commit with the point and I pres bb, magit does not propose anything, just tells me in minibuffer "Checkout:", so I have to select what I see in the main buffer, which is master3, master4, master. No trace of commits. However, I can type the commit myself and press enter (i won't be shown any autocompletion though). What version are you on? Feb 1 at 20:03
  • You need to be in the magit log buffer (l l) for this, not in the status buffer. EDIT: no, this is not true. It works in the status buffer too...
    – Marioba
    Feb 1 at 20:07
  • Magit 20210105.1030, Git 2.30.0, Emacs 27.1. But I'm sure this feature exists since a lot of time.
    – Marioba
    Feb 1 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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