Skip to content

Discard changes can be very slow #4581

@Dagur

Description

@Dagur

Describe the bug
Discarding a bunch of files can take a long time and the UI is frozen during the operation.

To Reproduce
Steps to reproduce the behavior:

  1. Select a decent amount of files (for example a package in node_modules that you don't need anymore)
  2. Press d to discard

Expected behavior
The UI should not lock up. Ideally this operation should be quick but if this is a limitation of git then I would like the operation to happen in the background or at least get some indication telling me that something is happening.

Version info:
Run lazygit --version and paste the result here
commit=6705428a8df4ef3480e8d03a2f5efc87129f0c42, build date=2025-05-22T12:59:02Z, build source=binaryRelease, version=0.51.0, os=linux, arch=amd64, git version=2.48.1

Run git --version and paste the result here
git version 2.48.1

Additional context
I'm on Ubuntu 25.04

Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions