jesseduffield/lazygit

"Local branches" when working with git trees

Opened this issue · 0 comments

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)