Status bar shows wrong Git branch (main) while terminal and git status show staging

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The Cursor UI showed the wrong active Git branch in the status bar (displayed main) while the repository was actually checked out on staging. Integrated terminal output from Git matched staging (git branch --show-current, git status -sb). After restarting Cursor, the UI matched Git again. Single-folder workspace, one repo root.

Steps to Reproduce

  1. Open a local Git repo in Cursor (single workspace folder).
  2. Check out branch staging (verify in terminal: git branch --show-current).
  3. Compare branch name shown in the Cursor status bar / SCM UI with Git output.
  4. (Optional) Have GitHub PR / diff views open; unclear if related.
  5. Observe mismatch; restart Cursor and compare again.

Expected Behavior

The branch shown in the UI (status bar / source control) should always match the current HEAD branch reported by Git in the same workspace.

Operating System

MacOS

Version Information

Version: 3.2.11
VSCode Version: 1.105.1
Layout: glass
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. This is a known bug. The status bar in Glass UI or SCM sometimes shows a stale branch, often main, while the terminal and git status are correct. We’re tracking the issue, but I can’t share an ETA yet.

The root cause is in the Git extension. The internal HEAD in CheckoutStatusBar sometimes doesn’t update via the file watcher after a checkout, and until the next successful refresh the status bar keeps showing the old value. Restarting Cursor, like you noticed, forces a fresh update of the repo model, which fixes the UI.

A couple quick workarounds until we ship a fix:

  • Cmd+Shift+P → Git: Refresh. This often updates the status without restarting.
  • Click the branch indicator in the status bar and re-select the same branch. This usually forces the UI to redraw.

If you can get a reliable repro, like a specific sequence of checkout via terminal then something triggers the UI and the branch doesn’t update, please share it here. Those steps really help us narrow down the race condition. Also, does this happen more often after a checkout from the terminal, or also when you checkout from the Source Control UI?