How can I tell magit to use the --first-parent option?

I only want to see commits onto this branch, none from merged branches.

1 Answer 1


--first-parent is included in current versions of Magit, but at a higher level than is shown by default in the transient menus.

Refer to C-hig (transient)Enabling and Disabling Suffixes for how to control this.

From the Magit Log menu you can either:

  • Change the default level for that menu using C-x l C-x l to make all those hidden options visible.
  • Change the level of --first-parent specifically with C-x l =p, to include it at your current level.

Alternatively, you can customize transient-default-level.

  • Looks like C-x l is bound to count-lines-page. Using C-h k: "C-x l runs the command count-lines-page (found in global-map), which is an interactive compiled Lisp function in ‘page.el’."
    – mcp
    Jun 6, 2021 at 3:58
  • Did you type it with the magit log transient menu open? If so, which version of Magit are you using?
    – phils
    Jun 6, 2021 at 7:33
  • Yup, that was my problem! I was trying it from the log buffer, not the transient menu. Marking as solution.
    – mcp
    Jun 7, 2021 at 16:46

Your Answer

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

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