Crates.io | clone-github-subdir |
lib.rs | clone-github-subdir |
version | 0.1.1 |
source | src |
created_at | 2023-07-30 07:40:15.13215 |
updated_at | 2023-07-30 07:45:47.849836 |
description | Clone any sub-directory of a Github repository to your local machine. |
homepage | https://github.com/isurfer21/clone-github-subdir |
repository | https://github.com/isurfer21/clone-github-subdir.git |
max_upload_size | |
id | 929786 |
size | 41,184 |
Clone any sub-directory of a Github repository to your local machine with this handy command-line tool. It is useful if you only want to clone a specific part of a repo.
You can install clone-github-subdir from crates.io using cargo:
cargo install clone-github-subdir
Or you can build it from source using git:
git clone https://github.com/isurfer21/clone-github-subdir.git
cd clone-github-subdir
cargo build --release
To use clone-github-subdir, first check if all set via short command cgs
along with --help
or -h
option, e.g.,
> cgs --help
Usage:
cgs [options] <link>
Arguments:
link Github sub-directory URL
Options:
-h, --help Show this help message
-v, --version Show the program version
-c, --curdir Current sub-directory only
You can also use the following options:
-h, --help
: Show the help message and exit.-v, --version
: Show the program version and exit.-c, --curdir
: Clone only the current sub-directory, not its parent directory.Now to clone the GitHub sub-directory, you can provide any GitHub repository's sub-directory URL as an argument, e.g.,
cgs https://github.com/second-state/wasm-learning/tree/master/nodejs/hello
This will clone the nodejs/hello
sub-directory of the second-state/wasm-learning
repo to your current working directory.
Alternatively, to clone only the target sub-directory, you can use --curdir
or -c
option , e.g.,
cgs -c https://github.com/second-state/wasm-learning/tree/master/nodejs/hello
This will clone only the hello
sub-directory, not its parent directory like nodejs/hello
.
This project is licensed under the MIT license. See the LICENSE file for more details.