mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-16 19:15:24 -06:00
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>