Fresh install of Cursor3.7, does not detected branch nor changed files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Just installed Cursor 3.7 on Ubuntu. Looks slick, but the “git diff” pane is completely broken - see attached image. There are a bunch of changes, and I am not on the “main” branch.

Restarting did not help at all.

Steps to Reproduce

I’ve got no idea. Seems to work for other people.

Screenshots / Screen Recordings

Operating System

Linux

Version Information

Version: 3.7.21
VS Code Extension API: 1.105.1
Commit: 517f696d8ab6c53eb04fbfdaae705cd146bf3460
Date: 2026-06-07T21:46:09.237Z
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
xterm.js: 6.1.0-beta.256
OS: Linux x64 6.17.0-35-generic

Does this stop you from using Cursor

Yes - Cursor is unusable

Thanks for the clear report and screenshot. This is a known issue with the Source Control / “Changes” pane in the Agents Window (the Glass layout) - on some startups it fails to load a valid repo and ends up showing the wrong branch with “Failed to load changes.” Your local git is fine; it’s the Agents Window’s git view that’s getting stuck.

Quickest way to unblock yourself: open the same folder in a classic Editor Window, where Source Control works normally.

  • Command Palette (Ctrl+Shift+P) → “Open Editor Window” (or Ctrl+Shift+N)

git from the integrated terminal also works against your repo in the meantime.

To help us pin down which variant you’re hitting on a fresh Linux install, could you grab the git logs?

  • View → Output, then choose “Git” from the dropdown on the right
  • Help → Toggle Developer Tools → Console tab

Paste the first error line you see (anything mentioning getGitRoot, spawn git ENOENT, or “no source control providers”). That one line tells us exactly which path is failing.

Hi Mohit,

So, here are the logs from View/Output/Git:

2026-06-10 17:58:21.496 [error] [GitHistoryProvider][resolveHEADMergeBase] Failed to resolve merge base for main: Error: No such branch: main.

2026-06-10 17:58:21.496 [info] > git hash-object -t tree /dev/null [68ms]

2026-06-10 17:58:21.497 [warning] [GitFileSystemProvider][readFile] File not found - git:/home/hristo/ceralinq/backend/.env.git?%7B%22path%22%3A%22%2Fhome%2Fhristo%2Fceralinq%2Fbackend%2F.env%22%2C%22ref%22%3A%22%22%7D

2026-06-10 17:58:21.497 [info] > git config --get commit.template [83ms]

2026-06-10 17:58:21.497 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [96ms]

2026-06-10 17:58:21.497 [warning] [Git][getBranch] No such branch: main

2026-06-10 17:58:21.499 [info] > git ls-files --stage – .env [109ms]

2026-06-10 17:58:21.499 [warning] [GitFileSystemProvider][stat] File not found - git:/home/hristo/ceralinq/backend/.env.git?%7B%22path%22%3A%22%2Fhome%2Fhristo%2Fceralinq%2Fbackend%2F.env%22%2C%22ref%22%3A%22%22%7D

2026-06-10 17:58:21.504 [info] > git config --get commit.template [31ms]

2026-06-10 17:58:21.536 [info] [Git][getRemotes] No remotes found in the git config file

2026-06-10 17:58:21.538 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/CER-216 refs/remotes/CER-216 [20ms]

2026-06-10 17:58:21.540 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [5ms]

2026-06-10 17:58:21.540 [warning] [Git][getBranch] No such branch: main

2026-06-10 17:58:21.565 [info] > git status -z -uall [14ms]

2026-06-10 17:58:21.566 [info] > git for-each-ref --sort -committerdate --format %(refname)%00%(objectname)%00%(*objectname) [3ms]

2026-06-10 17:58:21.673 [info] > git status -z -uall [30ms]

2026-06-10 17:58:21.675 [info] > git for-each-ref --sort -committerdate --format %(refname)%00%(objectname)%00%(*objectname) [13ms]

2026-06-10 17:58:21.727 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/CER-216 refs/remotes/CER-216 [24ms]

2026-06-10 17:58:21.749 [info] > git config --get --local branch.CER-216.vscode-merge-base [5ms]

2026-06-10 17:58:21.749 [warning] [Git][config] git config failed: Failed to execute git

2026-06-10 17:58:21.767 [info] > git config --get commit.template [41ms]

2026-06-10 17:58:21.771 [info] > git reflog CER-216 --grep-reflog=branch: Created from *. [4ms]

2026-06-10 17:58:21.823 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/CER-216 refs/remotes/CER-216 [20ms]

2026-06-10 17:58:21.823 [info] > git reflog HEAD --grep-reflog=checkout: moving from .* to CER-216 [36ms]

2026-06-10 17:58:21.846 [info] > git blame --root --incremental 3f624bfdbf650530c463fc782cbeb4bedb432e88 – .env [26ms]

2026-06-10 17:58:21.846 [info] fatal: no such path .env in 3f624bfdbf650530c463fc782cbeb4bedb432e88

2026-06-10 17:58:21.851 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [9ms]

2026-06-10 17:58:21.877 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/remotes/origin/main [6ms]

2026-06-10 17:58:21.970 [info] > git status -z -uall [29ms]

2026-06-10 17:58:21.971 [info] > git config --add --local branch.CER-216.vscode-merge-base origin/main [54ms]

2026-06-10 17:58:21.982 [info] > git for-each-ref --sort -committerdate --format %(refname)%00%(objectname)%00%(*objectname) [20ms] (cancelled)

2026-06-10 17:58:22.044 [info] > git config --get commit.template [39ms]

2026-06-10 17:58:22.047 [info] > git check-ignore -v -z --stdin [21ms]

2026-06-10 17:58:22.048 [info] > git check-ignore -v -z --stdin [6ms]

2026-06-10 17:58:22.071 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/CER-216 refs/remotes/CER-216 [5ms]

2026-06-10 17:58:22.108 [info] > git status -z -uall [17ms]

2026-06-10 17:58:22.111 [info] > git for-each-ref --sort -committerdate --format %(refname)%00%(objectname)%00%(*objectname) [3ms]

2026-06-10 17:58:22.143 [info] > git merge-base refs/heads/CER-216 refs/remotes/origin/CER-216 [17ms]

2026-06-10 17:58:22.160 [info] > git merge-base refs/heads/CER-216 refs/remotes/origin/CER-216 [18ms]

2026-06-10 17:58:22.182 [info] > git diff --name-status -z --diff-filter=ADMR 3f624bfdbf650530c463fc782cbeb4bedb432e88…refs/remotes/origin/CER-216 [7ms]

2026-06-10 17:58:22.183 [info] > git diff --name-status -z --diff-filter=ADMR 3f624bfdbf650530c463fc782cbeb4bedb432e88…refs/remotes/origin/CER-216 [24ms]

2026-06-10 17:58:23.782 [info] > git fetch [2446ms]

2026-06-10 17:58:23.782 [info] From ssh://gitlab.programista.pro:22122/aifactory/ceralinq/backend

492c593..a3cc06f main → origin/main

2026-06-10 17:58:23.806 [info] > git config --get commit.template [12ms]

2026-06-10 17:58:23.807 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/CER-216 refs/remotes/CER-216 [2ms]

2026-06-10 17:58:23.825 [info] > git status -z -uall [9ms]

2026-06-10 17:58:23.826 [info] > git for-each-ref --sort -committerdate --format %(refname)%00%(objectname)%00%(*objectname) [2ms]

2026-06-10 17:58:24.883 [info] > git config --get commit.template [15ms]

2026-06-10 17:58:24.885 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/CER-216 refs/remotes/CER-216 [3ms]

2026-06-10 17:58:24.915 [info] > git status -z -uall [16ms]

2026-06-10 17:58:24.917 [info] > git for-each-ref --sort -committerdate --format %(refname)%00%(objectname)%00%(*objectname) [3ms]

2026-06-10 17:58:29.642 [info] > git config --global user.name [1ms]

2026-06-10 17:58:29.660 [info] > git config --global user.email [2ms]

2026-06-10 17:58:29.660 [info] [main] Stored git author name in global state: Hristo Buyukliev [email protected]

2026-06-10 17:58:45.082 [info] [Git][getRemotes] No remotes found in the git config file

2026-06-10 17:58:45.098 [info] > git config --get commit.template [17ms]

2026-06-10 17:58:45.099 [info] > git for-each-ref --format=%(refname)%00%(upstream:short)%00%(objectname)%00%(upstream:track)%00%(upstream:remotename)%00%(upstream:remoteref) refs/heads/main refs/remotes/main [2ms]

2026-06-10 17:58:45.099 [warning] [Git][getBranch] No such branch: main

2026-06-10 17:58:45.137 [info] > git status -z -uall [19ms]

2026-06-10 17:58:45.137 [info] > git for-each-ref --sort -committerdate --format %(refname)%00%(objectname)%00%(*objectname) [3ms]

And here are error logs from Help/Developer Tools/Console which might be relevant:

======================

workbench.desktop.main.js:59060 [hasGithubAccess] unexpected error checking GitHub access: ConnectError: [invalid_argument] Error
at e (workbench.desktop.main.js:44926:700324)
at async Object.getGithubAccessTokenForRepos (workbench.desktop.main.js:35556:4377)
at async QQf (workbench.desktop.main.js:35612:94271)
at async a (workbench.desktop.main.js:59060:21422)

a @ workbench.desktop.main.js:59060

========================

workbench.desktop.main.js:48045 [background_composer] Error fetching branches Error: Could not determine default branch

  1. Object
error @ workbench.desktop.main.js:48045

============================

I couldn’t find any errors with getGitRoot, spawn git ENOENT, or “no source control providers”

Let me know what else I can do.

Another, possibly related symptom - the agent cannot run git commands in the shell:

I figured it out. The folder I opened does not have a .git file. It’s organised like so:

/<project_name>/backend, and /<project_name>/frontend, and they are separate repos.

If I open each repo directly it works.

I’ll leave the issue open in case you guys decide you want to add custom logic for this kind of scenario.