Skip to content

Allow opening a bare repo without any worktrees defined. #4330

Open

Description

@bartdorsey

Right now if you use bare repos with git worktree, lazygit is a bit more annoying to use that it should be.
If I clone down a bare repo and open lazygit in it, it fails with

Error: must be run inside a git repository

What would be ideal would be for lazygit to recognize it's a bare repo and go ahead and open.

Then you could use the w command to create new worktrees from the branches.

This would lead to a much smoother workflow for those using bare repos with worktrees.

Activity

  1. stefanhaller commented on Feb 26, 2025

    @stefanhaller
    Collaborator

    Duplicate of #4244. However, over there we didn't consider the use case of opening a bare repo in order to create a worktrees from within lazygit. Not sure if this changes the picture. It's still a lot of work, and I'm unsure it's justified for this little convenience.

  2. KeeWolf commented on Sep 25, 2025

    @KeeWolf

    I'm having pretty much the exact same problem.

    After discovering the power of worktrees, it became part of my workflow to download git repos in ~/git and maintain them from there, while doing actual development for them in worktrees in ~/projects.

    Usually I keep the main repo just checked out at main, but for some repos I need main checked out somewhere else. That's when I use bare repos in ~/git and that's where LazyGit refuses to open them and I scream at it: It's right there you moron! >:3

    Regardless, I've noticed that this seemingly is a non-trivial task. Therefore, I respect your judgment, if you say, this is not worth the effort for just a few people requesting it.
    However, I would very, very much appreciate, if this was made possible. 🫶

  3. markalanevans commented on Mar 26, 2026

    @markalanevans

    So the current workaround is to add at least one warp tier. And then run lazygit from the work tree directory, not from the bare repo directory. ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions