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

**URL:** <https://forum.cursor.com/t/git-ls-remote-did-not-return-a-resolvable-commit-for-head/166139>\
**Category:** Bug Reports\
**Tags:** plugins, cli\
**Created:** [July 20, 2026, 6:57am UTC](https://forum.cursor.com/t/git-ls-remote-did-not-return-a-resolvable-commit-for-head/166139 "2026-07-20T06:57:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carson\_coder](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@carson\_coder](https://forum.cursor.com/u/carson_coder)\
**Post date:** [July 20, 2026, 6:57am UTC](https://forum.cursor.com/t/git-ls-remote-did-not-return-a-resolvable-commit-for-head/166139/1 "2026-07-20T06:57:30Z")

</div>

### 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](https://docs.docker.com/ai/sandboxes/agents/cursor/) for details.

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

It fails with

```auto
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

```auto
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.

```auto
$ git ls-remote https://example.org/public/agents/agent-plugins.git exit 0
 a1084b7301320ad335936d94646ab3d92392e2ba HEAD
 a1084b7301320ad335936d94646ab3d92392e2ba refs/heads/main

```

```auto
$ git rev-parse HEAD exit 0
03af8d4e2f55ad5a516a75f034ca66354bfa2d9c

```

## environment

### Cursor

cursor: v2026.07.16-899851b

### Docker Image

```dockerfile
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](https://docs.docker.com/ai/sandboxes/get-started/)

- 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

---

<div class="post-metadata">

**Author:** ![mohitjain](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/mohitjain/32/100229_2.png) [@mohitjain](https://forum.cursor.com/u/mohitjain)\
**Post date:** [July 20, 2026, 8:53am UTC](https://forum.cursor.com/t/git-ls-remote-did-not-return-a-resolvable-commit-for-head/166139/7 "2026-07-20T08:53:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![carson\_coder](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@carson\_coder](https://forum.cursor.com/u/carson_coder)\
**Post date:** [July 20, 2026, 12:14pm UTC](https://forum.cursor.com/t/git-ls-remote-did-not-return-a-resolvable-commit-for-head/166139/8 "2026-07-20T12:14:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [July 22, 2026, 12:14pm UTC](https://forum.cursor.com/t/git-ls-remote-did-not-return-a-resolvable-commit-for-head/166139/9 "2026-07-22T12:14:47Z")

</div>

Closed on July 22, 2026, 12:14pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
