jesseduffield / jesseduffield/lazygit

Lazygit stuck in “Rebasing” state when .git/rebase-merge is partially written

Open
#5,184 2 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
Lazygit enters a permanent rebase state and becomes non-functional, even though Git itself reports that no rebase is in progress.

Attempting to abort, skip, or continue the rebase from lazygit results in the following error: `Warning: Could not read '.git/rebase-merge/head-name': No such file or directory

`Restarting lazygit only opens it up in the same state.

Deleting the following manually immediately resolved the issue:
```
rm -r .git/rebase-merge
rm .git/ORIG_HEAD
```

### To Reproduce
I have not been able to reliably reproduce this issue.

It happened while interacting with the latest commit (using `e` or `s` in lazygit). Subsequent attempts using the same steps did not trigger the issue, and the rebase could be aborted normally.

### Expected behavior
Consistent and graceful error handling or ability to abort rebase.

### Screenshots
Image

### Version info:
```
$ lazygit --version
commit=, build date=, build source=nix, version=0.57.0, os=linux, arch=amd64, git version=2.52.0

$ git --version
git version 2.52.0
```

### Additional context
At the time of the issue, the `.git/rebase-merge/` directory existed but contained only a single file. The expected `head-name` file was missing.

Initially I suspected this might have been triggered by a permission error while editing a file during the rebase. However, after further testing (including intentionally creating directories without write permissions), I was unable to reproduce the issue, so this may not be directly related to permissions.

I am running on NixOS, and this occurred shortly after checking for updates.

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.