Skip to content

bug: rtk gh issue view -R fails outside git repo (plain gh works) #223

@pavelbe

Description

@pavelbe

Summary

rtk gh issue view ... -R <owner/repo> fails outside a git repository with:

failed to run git: fatal: not a git repository (or any of the parent directories): .git

This breaks parity with plain gh, which works with -R from any directory.

Environment

  • rtk: 0.22.0
  • gh: authenticated and working
  • OS: Linux (WSL2 Ubuntu)
  • checked on: 19 February 2026

Reproduction

Run from a non-repo directory (e.g. /home/pavelbe/hca-system-v3):

gh issue view 185 -R rtk-ai/rtk --json number,title
# exit 0

/home/pavelbe/bin/rtk gh issue view 185 -R rtk-ai/rtk --json number,title
# exit 1
# failed to run git: fatal: not a git repository (or any of the parent directories): .git

Expected

rtk gh issue view ... -R rtk-ai/rtk should work outside git repositories, same as plain gh.

Actual

RTK path fails due to implicit git-repo dependency even when explicit -R is provided.

Impact

  • breaks global/ops scripts that query GitHub from arbitrary directories,
  • forces fallback to raw gh/rtk proxy gh for basic read operations.

Notes

No duplicate open/closed issue was found with queries:

  • rtk gh issue view -R not a git repository
  • failed to run git fatal not a git repository rtk gh
  • rtk gh not a git repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions