Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: Could not read from remote repository

未关闭
#32 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
git, github
领域
devtools

调研方向

首先跟踪 worktree.create 为 git fetch origin "main" 使用的 git 子进程,然后将其工作目录和环境与用户的终端进行比较。使用 includeIf 和 core.sshCommand 配置 GitHub 多账户环境进行复现;当需要所选 SSH 密钥的仓库能够通过 Polyscope 成功 fetch 时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Platform

macOS

Operating system version

macOS Tahoe 26.3

System architecture

ARM64 (M1, M2, etc)

PolyScope Version

0.7.0

Bug description

Hello! First, the app looks amazing, the remote feature is exactly what I was looking for coming from Conductor which I use daily. I can't wait to be able to try it out.

When adding a repository from a local path, it fails to fetch the remote. The same git fetch origin "main" command works perfectly from my terminal.

I've since identified the root cause (thus the issue update). I use two GitHub accounts (personal and work) with includeIf directives in ~/.gitconfig to set core.sshCommand per directory, selecting the correct SSH key for each account. Here's the expected flow:

  1. Git reads ~/.gitconfig
  2. includeIf "gitdir/i:~/Code/" matches → includes ~/Code/.gitconfig
  3. core.sshCommand = "ssh -o IdentitiesOnly=yes -i ~/.ssh/github-perso" is set
  4. SSH authenticates as the correct account

What happens in Polyscope:

  1. Polyscope spawns git fetch origin "main"
  2. includeIf is not evaluated (likely because Polyscope runs git from a different working directory, or strips/overrides environment variables like HOME)
  3. No core.sshCommand is set
  4. SSH falls back to the agent, tries keys in order, and authenticates as my other account
  5. GitHub returns "Repository not found" (that account can't access this repo)

Supporting evidence:

  • Repos owned by my work account (whose SSH key happens to be tried first by the agent) work fine in Polyscope
  • Repos owned by my personal account consistently fail with ERROR: Repository not found
  • From terminal: ssh -T git@github.com → work account (default agent order), while ssh -o IdentitiesOnly=yes -i ~/.ssh/github-perso -T git@github.com → personal account
  • Other tools that shell out to git (Conductor, OpenCode) evaluate includeIf correctly

Likely fix: Ensure the git subprocess inherits the user's full environment (especially HOME) and that the working directory is set to the repo path before running git fetch, so that includeIf "gitdir:..." patterns can match correctly.

My issue is likely related to https://github.com/beyondcode/polyscope-community/issues/17 — both point to the subprocess environment not matching the user's shell environment.

I also have a custom gh wrapper script with similar per-account logic. I also use Conductor and the OpenCode GUI which work flawlessly with this setup.

Let me know if I can help debug further. Have a great day!

Steps to reproduce
  • Have a multi-account GitHub setup using includeIf + core.sshCommand in ~/.gitconfig
  • Open Polyscope
  • Click "Choose repository"
  • Choose a repository that requires the includeIf-resolved SSH key (not the default agent key)
  • Wait for it to load
  • The error notification appears in the bottom right corner (see screenshot)
Image
Relevant log output
[server:err] ERROR: Repository not found.
[server:err] fatal: Could not read from remote repository.
[server:err] [ws] worktree.create error: Command failed: git fetch origin "main"

(Full logs available on request — the error repeats on every worktree.create attempt. A secondary Command "sites" is not defined error also appears on every repo.add.)

主要语言
没有语言数据
星标
20
派生
0
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

beyondcode/polyscope-community 的其他 Issue

查看 beyondcode/polyscope-community 的全部 Issue

相似的 Issue

更多 DevTools Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。