Skip to main content

clone

Function clone 

Source
pub fn clone(
    url: &str,
    dest: &Path,
    branch: Option<&str>,
    shallow: bool,
    submodules: bool,
) -> Result<Repository, String>
Expand description

Clone a remote repository into dest.

Parameters:

  • url: remote URL (HTTPS or file://)
  • dest: target directory (must not exist or be empty)
  • branch: optional branch/ref name to checkout after clone
  • shallow: when true, fetches only the latest commit (like --depth 1)
  • submodules: when true, recursively initializes submodules