Repository navigation
Description
Summary
git fetch origin <branch> run through rtk is rewritten into git's "could not read from remote repository / please make sure you have the correct access rights and the repository exists" failure message — even though the fetch actually succeeds (exit code 0).
Running the exact same command with rtk proxy git fetch origin <branch> shows the real, successful output:
* branch <branch> -> FETCH_HEAD
with exit code 0. So this is rtk reshaping a successful fetch into a fake access/repository error, not a real git/network/permission problem.
Steps to reproduce
In any git repo that has a valid origin remote and an existing branch main:
rtk git fetch origin main
→ reported as an access-rights / repository-does-not-exist failure (fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.). On a non-English locale this surfaces as the localized translation of the same message.rtk proxy git fetch origin main
→* branch main -> FETCH_HEAD, exit code0(real success).
Note that other git remote operations are not affected and pass through correctly through rtk:
rtk git ls-remote origin— finertk git push— fine
Only git fetch origin <branch> is misclassified.
Expected
rtk should pass git fetch through faithfully. An exit code of 0 means the fetch succeeded and should be reported as success (or summarized without inventing a failure).
Actual
A successful git fetch (exit 0) is rewritten into an "access rights / repository exists" failure, which misleads the user/agent into believing there is a permission or missing-repository problem when there is none.
Environment
- rtk version:
0.41.0 - OS: macOS
- Command shape:
git fetchwith an explicit refspec (origin <branch>)
Suggested fix / direction
- Treat the
git fetchexit code as the source of truth (0 = success). Do not infer failure from stderr content. git fetchnormally writes its progress + ref-update summary (From <remote>,* branch <branch> -> FETCH_HEAD) to stderr as normal, expected behavior — rtk must not classify these stderr lines as an error.- Do not synthesize the "correct access rights / repository exists" wording unless git itself exited non-zero with that exact error.
- Add
git fetchto the same faithful / pass-through handling that the other git remote subcommands (ls-remote,push) already use correctly.
Activity
pszymkowiak commentedon Jun 2, 2026
🔍 Automated Triage
bughighSummary
rtk rewrites successful git fetch (exit 0) into a fake access/repository error by misclassifying normal stderr progress output as failure; fix by trusting exit code over stderr content for git fetch.
Triaged automatically by wshm · This is an automated analysis, not a human review.
fix(git): fix git fetch falsely reporting access error — inherit stdi…