Open scallaway opened 5 months ago
Just today I ran into the same situation as you when testing bare repos on lazygit and personally I find it confusing. I think that I have a couple of suggestions to enhance the experience when working with worktrees on a bare repo:
Ability to execute lazygit in the root of the bare repo, right now you have to go into one of the worktrees for lazygit to be able to launch. This is just a minor QoL not having to do cd once more and go to a worktree before calling lazygit.
I think in the case of a bare repo, worktrees currently located in panel 2 should replace local branches in panel 3. That way you avoid the confusion and all the clutter with local branches. Also allows for a speedier workflow since you don't have to be changing panel's 2 depth to see files status.
To be honest, I'm not quite sure about the rationale to put worktrees on pane 2, my understanding is that while you can do worktrees on a NOT bare repo, as per ThePrimeagen video on it (link here), the structure is a mess. Thus I think the recommendation is to use bare repos when using worktrees such that you can use them as independent branches, which would lead to this recommendation.
I'll keep on experimenting with bare repos and I'll keep on providing feedback.
Discussion was the best label to put this under, but it's more a question for my understanding.
I've started using Worktrees as I finally have a decent use-case for them, but the one thing I'm noticing is that Lazygit seems to report all the branches that are on remote as "Local branches", even if they don't have any upstream associated with them.
In my case, this results in some 700 branches being listed in the "local branches", where I try and keep that as clean as possible (removing local branches that have been deleted on remote).
Is this purely because I cloned the repository with
--bare
? Or is it due to the interaction with worktrees. I didn't want to clone regularly and then work with worktrees as the additional folders it creates (for each worktree) would confuse things.I've also tried running a
git remote prune origin
now that I've added an upstream, but that doesn't seem to sort things either.Just some clarification on how this works would be great! (And anyway to clear out those excess branches)