Lazygit's Four Merge Options Explained: How Each Shapes Your Git History

Lazygit's 'M' key in the branches panel opens a menu with four distinct merge options, each producing a different commit graph in Git history. The default 'm' option fast-forwards when possible, leaving a linear history with no merge marker, but falls back to a merge commit if the target branch has moved. The 'n' option always creates a merge commit with two parents, permanently marking where a branch was integrated. Squash merge options ('s' and 'S') condense all source branch commits into one, either leaving it uncommitted or committing it immediately. A developer documented these differences by building a throwaway repository and testing each option individually, using 'git log --oneline --graph' to observe the resulting history shape.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in