Skip to content

Conversation

@TeckniX
Copy link

@TeckniX TeckniX commented Oct 11, 2025

When creating a repo clone, it's often convenient to match the org with the repo name.
During a normal gh repo clone operation, and wanting to contribute to various CLI repo, you would default to the code attempting to be checked out in the same cli directory.
e.g.

Trying to run any of the above commands in a common ~/go/src/github.com directory would result in the following error:

fatal: destination path 'cli' already exists and is not an empty directory.
failed to run git: exit status 128

You can obviously pass your own repo name, but it can get quite verbose to type (aka https://github.com/react-native-community/cli)

This PR adds the --match flag, allowing for a simple flag to indicate your desire to match the owner/repo dir structure.
going from:

$ gh repo clone cli/cli
Cloning into 'cli'...

to then having to be explicit:

$ gh repo clone react-native-community/cli react-native-community/cli
Cloning into 'react-native-community/cli'...

to what you were trying to do in the first place:

$ gh repo clone react-native-community/cli --match
Cloning into 'react-native-community/cli'...

Fixes #11904

@TeckniX TeckniX requested a review from a team as a code owner October 11, 2025 22:54
@TeckniX TeckniX requested a review from BagToad October 11, 2025 22:54
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Oct 11, 2025
@cliAutomation
Copy link
Collaborator

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

wtch-ops

This comment was marked as spam.

@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.

[Feature] Add support for easily matching the owner/repo structure

3 participants