Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@majiayu000
Copy link

Summary

Return an explicit error when --remote flag is used with a repository argument in gh repo fork.

When a repository argument is provided, the command operates independently of the current local repository. Using --remote in this context is incompatible because there is no local repository to add the remote to.

Before this fix, the --remote flag was silently ignored. Now it returns:

the `--remote` flag is unsupported when a repository argument is provided

Fixes #2722

When a repository argument is provided to `gh repo fork`, the command
operates independently of the current local repository. Using --remote
in this context is incompatible because there's no local repository to
add the remote to.

This change returns an explicit error when these flags are combined,
providing clear feedback instead of silently ignoring the --remote flag.

Fixes cli#2722

Signed-off-by: majiayu000 <[email protected]>
@majiayu000 majiayu000 requested a review from a team as a code owner December 26, 2025 06:44
@majiayu000 majiayu000 requested a review from BagToad December 26, 2025 06:44
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Dec 26, 2025
@github-actions
Copy link

Thank you for your pull request! 🎉

This PR appears to fix the following issues that are not labeled with help wanted Contributions welcome :

As outlined in our Contributing Guidelines, we expect that PRs are only created for issues that have been labeled help wanted.

While we appreciate your initiative, please note that:

  • PRs for non-help wanted issues may not be reviewed immediately as they might not align with our current priorities
  • The issue might already be assigned to a team member or planned for a specific release
  • We may need to close this PR. For example, if it conflicts with ongoing work or architectural decisions

What happens next:

  • Our team will review this PR and the associated issues
  • We may add the help wanted label to the issues, if appropriate, and review this pull request
  • In some cases, we may need to close the PR. For example, if it doesn't fit our current roadmap

Thank you for your understanding and contribution to the project! 🙏

This comment was automatically generated by cliAutomation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Repo fork ignores the --remote flag when specifying a repository via argument

2 participants