Enable matching of repo structure during clone #11902
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When creating a repo clone, it's often convenient to match the org with the repo name.
During a normal
gh repo cloneoperation, and wanting to contribute to various CLI repo, you would default to the code attempting to be checked out in the sameclidirectory.e.g.
gh repo clone cli/cligh repo clone npm/cligh repo clone httpie/cliTrying to run any of the above commands in a common
~/go/src/github.comdirectory would result in the following error: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
--matchflag, allowing for a simple flag to indicate your desire to match the owner/repo dir structure.going from:
to then having to be explicit:
to what you were trying to do in the first place:
Fixes #11904