Skip to content

"Open File" in a branch gives you the current file #4327

@Dagur

Description

@Dagur

Describe the bug

Sometimes I want to view a file as it was when it was commited but currently it's not possible because lazygit always opens the file directly from the file system (i.e. the active branch).

To Reproduce
Steps to reproduce the behavior:

  1. Let's say that the active branch is main.
  2. View any other branch under Local Branches
  3. Open a commit and highlight a file.
  4. If you press o (Open File), an editor will open with the contents of the file on main, not the version that belongs to that commit.

Expected behavior
I want to see how the file looked when it was committed.

Version info:
Run lazygit --version and paste the result here
commit=4e38a941de3baf9e50d3fd5432933d6efccff091, build date=2025-02-25T11:24:06Z, build source=binaryRelease, version=0.47.2, os=linux, arch=amd64, git version=2.45.2

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

Additional context
This might be by design, and if that's the case then look at this as a feature request :)

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