Skip to content

Show branch name and detached HEAD in worktrees tab#5339

Open
ruudk wants to merge 1 commit intojesseduffield:masterfrom
ruudk:improve-worktrees-presentation
Open

Show branch name and detached HEAD in worktrees tab#5339
ruudk wants to merge 1 commit intojesseduffield:masterfrom
ruudk:improve-worktrees-presentation

Conversation

@ruudk
Copy link
Contributor

@ruudk ruudk commented Mar 4, 2026

PR Description

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
    • Not sure how this works when changing keys?
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

The worktrees tab now displays the checked-out branch (or detached HEAD state) for each worktree, making it much easier to see which worktree holds which branch.

This is useful when you need to "unlock" a branch that's occupied by another worktree: you can now clearly see which worktrees are on a branch vs detached, without having to select each one individually.

Also rename the "(main)" label to "(main worktree)" to avoid confusion with the common "main" branch name, and move it after the branch column.

Screenshot 2026-03-04 at 13 21 38@2x

Note

I used to work intensively with Go years ago. I created this PR with Claude Code but I have read through it and I think it makes sense. I also tested this on my own project where I use worktrees a lot.

The worktrees tab now displays the checked-out branch (or detached HEAD
state) for each worktree, making it much easier to see which worktree
holds which branch.

This is useful when you need to "unlock" a branch that's occupied by
another worktree: you can now clearly see which worktrees are on a
branch vs detached, without having to select each one individually.

Also rename the "(main)" label to "(main worktree)" to avoid confusion
with the common "main" branch name, and move it after the branch column.
@ruudk
Copy link
Contributor Author

ruudk commented Mar 4, 2026

@stefanhaller PR is ready (CI green). Whenever you have time. Curious to hear your thoughts on this one.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant