Skip to content

PR skill: Add gh auth setup-git step before pushing to fork #47

@ambient-code

Description

@ambient-code

Problem

When running the /pr skill in environments where git credentials aren't pre-configured, git push fails with:

fatal: could not read Username for 'https://github.com': No such device or address

This happens even when gh auth status shows successful authentication, because the git credential helper isn't configured to use gh for authentication.

Root Cause

The GitHub CLI (gh) is authenticated, but git itself doesn't know to use gh as its credential helper. The gh auth setup-git command configures this, but it's not currently part of the PR skill workflow.

Recommended Solution

Add a step to run gh auth setup-git before attempting to push. This should be added to Step 6: Push to Fork:

Current Step 6:

git push -u fork bugfix/BRANCH_NAME

Proposed Step 6:

# Ensure git uses gh for authentication
gh auth setup-git

# Push the branch
git push -u fork bugfix/BRANCH_NAME

Additional Context

This was discovered during the implementation of #44 (fork sync detection). The push initially failed, but succeeded after running gh auth setup-git.

Acceptance Criteria

  • Step 6 includes gh auth setup-git before git push
  • Error Recovery table includes guidance for credential helper issues
  • The skill works in fresh environments where git credentials aren't pre-configured

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