Git ls-remote did not return a resolvable commit for HEAD

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Error

I want to install a marketplace from a private git-server with a valid
TLS-certificate and which is reachable. Cursor runs in a docker sandbox -
see Cursor | Docker Docs for details.

The installation of the very same marketplace works fine for claude code and
codex.

It fails with

Failed to resolve git ref "HEAD" for https://example.org/public/agents.git: git ls-remote did not return a resolvable commit for HEAD

for cursor.

The full error

Plugins Installed  Marketplace  (←/→ or tab to cycle)

Pasted Link

┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ⌕ https://example.org/public/agents/agent-plugins.git                                                                                     │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

Failed to resolve git ref "HEAD" for https://example.org/public/agents.git: git ls-remote did not return a resolvable commit for HEAD
(https://example.org/public/agents.git)

Running the commands myself in the same sandbox in “!” mode in cursor works fine.

$ git ls-remote https://example.org/public/agents/agent-plugins.git exit 0
 a1084b7301320ad335936d94646ab3d92392e2ba    HEAD
 a1084b7301320ad335936d94646ab3d92392e2ba    refs/heads/main
$ git rev-parse HEAD exit 0
03af8d4e2f55ad5a516a75f034ca66354bfa2d9c

environment

Cursor

cursor: v2026.07.16-899851b

Docker Image

FROM docker/sandbox-templates:cursor-agent-docker
USER root
# hadolint ignore=DL3008
RUN apt-get update \
    && apt-get install -y --no-install-recommends locales fonts-liberation \
    && locale-gen en_US.UTF-8 \
    && update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
    && rm -rf /var/lib/apt/lists
ENV LANG=en_US.UTF-8 \
    LC_ALL=en_US.UTF-8 \
    LANGUAGE=en_US:en
# hadolint ignore=DL3008
RUN apt-get update \
    && apt-get install -y --no-install-recommends imagemagick ghostscript graphviz texlive-latex-recommended \
    && rm -rf /var/lib/apt/lists
# hadolint ignore=DL3008
RUN apt-get update \
    && apt-get install -y --no-install-recommends vim curl tar xz-utils shellcheck weasyprint pandoc \
    && rm -rf /var/lib/apt/lists

RUN chown -R agent:agent /home/agent
USER agent
RUN agent update && rm -rf ~/.cursor ~/.cache

Steps to Reproduce

Setup sbx - Get started with Docker Sandboxes | Docker Docs

  • brew trust docker/tap
  • brew install docker/tap/sbx
  • sbx login

run cursor in sandbox

  • sbx run cursor
  • /plugin marketplace add htxxps://example.org/public/agents/agent-plugins.git

Expected Behavior

Marketplace is installed

Operating System

MacOS

Version Information

cursor: v2026.07.16-899851b

For AI issues: which model did you use?

Auto

Does this stop you from using Cursor

Yes - Cursor is unusable

Hey @carson_coder,
I reproduced it on my end, so this is on our side, not your sandbox, TLS, or network. The problem is in how the marketplace installer reads the repo URL: on a self-hosted git host it keeps only the first two path segments (<owner>/<repo>) and drops anything deeper. So your https://example.org/public/agents/agent-plugins.git gets shortened to https://example.org/public/agents.git before git ls-remote runs. That shortened URL is exactly what shows up in the error, and it’s why HEAD can’t be resolved even though the full URL clones fine by hand.

Workaround: host the marketplace repo at a two-level path, i.e. https://example.org/<owner>/<repo>.git (the repo directly under a single namespace) rather than a nested /<group>/<subgroup>/<repo>.git. A two-segment path parses correctly and installs. I realize that may not match your server’s layout, so treat it as a stopgap rather than a real fix.

This is a known limitation with multi-level repo paths on self-hosted git servers, and I’ve reported your case to our team. I’ll follow up here once there’s an update. If a two-segment path isn’t workable for you, let me know and I’ll look into other options.

Awesome. That helped a lot: I set up a mirror repo as a workaround matching the required URL structure. Thank you very much.