Files
Stefan HallerandClaude Opus 5.5 73ac8fe6c6 Allow merging into a detached HEAD
Pressing the merge key while HEAD is detached shows an error. This also
happens during a rebase and during a bisect, because HEAD is detached
then. As a result, you can't squash merge another branch at the base of
the current one by starting an interactive rebase with `i`. The
workaround is to squash merge the branch at the tip and move the commit
down. If the merged changes conflict with the branch's own commits, you
have to resolve those conflicts twice this way.

Remove the check. A merge on a detached HEAD is no riskier than a
commit, a cherry-pick or a revert, and lazygit allows all of those
there. It is also useful outside of a rebase, for example to check out
master as a throwaway detached HEAD and merge several branches into it
to see whether they conflict. There is no reason to prevent the user
from doing these things.

If the merge conflicts during a rebase, the merge takes precedence over
the rebase in the working tree state. So continuing goes to the merge
first and then to the rebase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 14:59:01 +01:00
..
2026-11-14 14:59:01 +01:00
2026-07-31 08:42:51 +02:00
2026-05-26 09:45:41 +02:00