clone-github-subdir

Crates.ioclone-github-subdir
lib.rsclone-github-subdir
version0.1.1
sourcesrc
created_at2023-07-30 07:40:15.13215
updated_at2023-07-30 07:45:47.849836
descriptionClone any sub-directory of a Github repository to your local machine.
homepagehttps://github.com/isurfer21/clone-github-subdir
repositoryhttps://github.com/isurfer21/clone-github-subdir.git
max_upload_size
id929786
size41,184
Abhishek Kumar (isurfer21)

documentation

README

clone-github-subdir

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.

Installation

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

Usage

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.

License

This project is licensed under the MIT license. See the LICENSE file for more details.

Commit count: 13

cargo fmt