Detached HEAD state not clearly indicated in Sourcetree repository view
0 reputation · 02 Apr 2021, 03:03 UTC
0 reputation · 02 Apr 2021, 03:03 UTC
Sourcetree provides a visual repository browser with a side‑by‑side diff view and a commit graph that tracks branch history.
The application also supports built‑in Git LFS integration and multiple Git accounts via SSH identity files or credential helpers.
However, the UI does not clearly indicate when the current HEAD is detached, which can lead to confusion about the repository state. Users must infer the state from the lack of a branch label.
What visual indicator should be added to show a detached HEAD state? Is there a configuration option to expose this status in the UI? How does Sourcetree’s current behavior compare to other Git clients in displaying detached HEAD?
31775 reputation · 02 Apr 2021, 03:46 UTC
Sourcetree does not currently offer a configuration option that adds a persistent, prominent detached-HEAD indicator. There is no setting in the preferences that forces a warning badge, banner, or color change when HEAD is detached. What the UI already shows is subtle: the current-branch label in the sidebar or toolbar shows HEAD (or a commit hash) instead of a branch name, and the commit graph node for the checked-out commit lacks the colored branch label that attached commits carry. If you want an unambiguous signal today, the reliable path is the terminal, not the GUI.
Confirmed: Git itself reports the state unambiguously. Running git status prints HEAD detached at <commit>, and git symbolic-ref -q HEAD exits non-zero when detached. Sourcetree faithfully reflects this by omitting a branch name — the information is present, just not emphasized.
Likely explanation: Sourcetree's design treats the branch label's absence as sufficient signal. In practice, users scanning the sidebar read the label position habitually and miss that it says HEAD rather than a branch name, which is exactly the confusion described. This appears to be a long-standing UX gap rather than a bug, and community feature requests for a clearer indicator have existed for years without a shipped fix — though I cannot confirm the current state of Atlassian's tracker, so treat that as unverified.
Other Git GUIs are generally more explicit, though exact styling varies by version:
Against that baseline, Sourcetree's "absence of a branch label" approach is the weakest signal of the group. Exact visuals differ across releases, so verify against the version you run.
git status
git symbolic-ref -q --short HEAD || echo "DETACHED"git switch -c recovery-branchor reattach to an existing branch with git switch <branch> if no new commits were made.Indicator visibility has varied across Sourcetree versions and platforms (Windows and macOS builds have historically diverged), so the exact sidebar wording described here may not match your release. There is no supported plugin or theme mechanism for adding a custom detached-HEAD badge; third-party modifications are unsupported and may break on updates. If a clear in-app indicator matters to your workflow, the durable fixes are a terminal-based check or a client that surfaces the state explicitly.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.