Replies: 1 comment
-
In general we try to have a light touch with respect to wrapping |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there the ability to (or merit in adding) the ability to clone a subdirectory and initialise it as a new repo?
For example if you had independent packages within your main repository and you only wanted to grab a particular one?
Something essentially like
gh repo clone <repository> [-s <repo_subdirectory>] [<directory>] [-- <gitflags>...]
So
gh repo clone my/repository -s path/to/my/package
would clone the contents found within the urlhttps://github.com/my/repository/tree/master/path/to/my/package
Once cloned it would then do a
git init
to make it a new repository so the rest of the standardgh
commands can be used to create a new repo etc.Or create it as an entirely new command to keep it from messing up the standard one by adding extra options, like
gh repo clone-subdir
.The reason is that this seems to be a generally under supported type of workflow. There are git commands such as
sparse-checkout
but these aren't particularly easy to work out, otherwise it means cloning the entire repo and copying just the bits you want or using a tool like https://download-directory.github.io/ to get the zip of just that subdirectory, unzip it and init the repo there.Beta Was this translation helpful? Give feedback.
All reactions