jesseduffield / jesseduffield/lazygit

Squashing all fixup! commits in current branch doesn't work on main

Open
#5,087 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

### Describe the bug
When the current branch is `main`, pressing `Shift-S`, `b` to squash all fixup! commits in the current branch does nothing.

This can be worked around by selecting a commit below the oldest one to be fixed up and pressing `Shift-S`, `a`.

Squashing all commits in the current branch works in branches other than the main branch.

### To Reproduce
Steps to reproduce the behaviour:

1. Create five commits.
2. Create a new branch and switch to it.
3. Make a change and stage it.
4. Select the third commit in the commit list.
5. Press `Shift-F`, `f` to create a fixup! commit.
6. Press `Shift-S`, `b`.
7. Change back to the main branch.
8. Repeat steps 3–6.

### Expected behaviour
In both cases, the fixup! commit should be squashed into the commit it fixes up.

In reality, this works when the branch is not the main branch, and fails silently on the main branch.

### Screenshots
If applicable, add screenshots to help explain your problem.

### Version info:

* commit=, build date=, build source=Homebrew, version=0.56.0, os=darwin, arch=arm64, git version=2.52.0
* git version 2.52.0

### Additional context

> [!NOTE]
> Please try updating to the latest version or [manually building](https://github.com/jesseduffield/lazygit/#manual) the latest `master` to see if the issue still occurs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.