[BUG] opencode github install - "Could not find git repository" in valid git repo #4726

Open
opened 2026-02-16 17:45:11 -05:00 by yindo · 2 comments
Owner

Originally created by @PrakharMNNIT on GitHub (Jan 11, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

The opencode github install command fails with the error "Could not find git repository" even when executed from inside a valid git repository where git status works correctly.

The .git directory exists, all git commands work as expected, but the opencode github install command cannot detect the repository.

OpenCode version

1.1.13

Steps to reproduce

  1. Navigate to a valid git repository:

    cd ~/path/to/repo
    
  2. Confirm git is working:

    git status
    # Output: On branch master, Your branch is up to date with 'origin/master'.
    
  3. Verify .git directory exists:

    ls -la .git
    # Shows valid .git directory with all expected contents
    
  4. Run the install command:

    opencode github install
    
  5. Result: Error message appears:

    ┌  Install GitHub agent
    │
    ■  Could not find git repository. Please run this command from a git repository.
    

Screenshot and/or share link

N/A - Error is text-based and reproduced above.

Operating System

macOS 26.2 (Build 25C56)

Terminal

iTerm2

Additional Context

  • OpenCode installed via Homebrew (/opt/homebrew/bin/opencode)
  • The repository has a remote configured (origin/master)
  • All standard git operations work correctly
  • Tried running from both the repository root and parent directories with same result
Originally created by @PrakharMNNIT on GitHub (Jan 11, 2026). Originally assigned to: @rekram1-node on GitHub. ## Description The `opencode github install` command fails with the error "Could not find git repository" even when executed from inside a valid git repository where `git status` works correctly. The `.git` directory exists, all git commands work as expected, but the `opencode github install` command cannot detect the repository. ## OpenCode version 1.1.13 ## Steps to reproduce 1. Navigate to a valid git repository: ```bash cd ~/path/to/repo ``` 2. Confirm git is working: ```bash git status # Output: On branch master, Your branch is up to date with 'origin/master'. ``` 3. Verify `.git` directory exists: ```bash ls -la .git # Shows valid .git directory with all expected contents ``` 4. Run the install command: ```bash opencode github install ``` 5. **Result:** Error message appears: ``` ┌ Install GitHub agent │ ■ Could not find git repository. Please run this command from a git repository. ``` ## Screenshot and/or share link N/A - Error is text-based and reproduced above. ## Operating System macOS 26.2 (Build 25C56) ## Terminal iTerm2 ## Additional Context - OpenCode installed via Homebrew (`/opt/homebrew/bin/opencode`) - The repository has a remote configured (`origin/master`) - All standard git operations work correctly - Tried running from both the repository root and parent directories with same result
Author
Owner

@github-actions[bot] commented on GitHub (Jan 11, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #5614: Github Install couldn't find git repository

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 11, 2026): This issue might be a duplicate of existing issues. Please check: - #5614: Github Install couldn't find git repository Feel free to ignore if none of these address your specific case.
Author
Owner

@mattgillard commented on GitHub (Feb 6, 2026):

i have the same issue. It seems the format of my git remote doesnt match.

git@mattgillard.github.com:orgname/<repo>.git

I use this format to ensure i am using the right ssh key - via a ~/.ssh/config

ssh -T git@mattgillard.github.com
Hi mattgillard! You've successfully authenticated, but GitHub does not provide shell access.
@mattgillard commented on GitHub (Feb 6, 2026): i have the same issue. It seems the format of my git remote doesnt match. ``` git@mattgillard.github.com:orgname/<repo>.git ``` I use this format to ensure i am using the right ssh key - via a ~/.ssh/config ```bash ssh -T git@mattgillard.github.com Hi mattgillard! You've successfully authenticated, but GitHub does not provide shell access. ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4726