Cursor Git Panel Pushing to main even when branch is checked out

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The cursor IDE’s git panel’s sync button was pushing directly to main even though I was checked out on a branch.

Steps to Reproduce

I am not sure how to reproduce this but I was in a git worktree if that helps.

Expected Behavior

I expect that the sync button would never perform actions on a different branch than what is checked out.

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 3.2.21 (Universal)
VSCode Version: 1.105.1
Commit: 806df57ed3b6f1ee0175140d38039a38574ec720
Date: 2026-05-03T01:46:14.413Z
Layout: editor
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

This is a known bug with git worktrees. Our team is tracking the issue. No fix has shipped yet, but a couple of things you can do in the meantime:

  1. Use the terminal for push/pull when working in worktrees — git push origin HEAD will always target the correct branch

  2. Check the Sync tooltip before clicking (as you caught in your screenshot) — if it says origin/main when you’re on a feature branch, fall back to the terminal

Thanks for the screenshot showing the mismatch between the commit input and Sync target — that’s helpful evidence.