git2-rs icon indicating copy to clipboard operation
git2-rs copied to clipboard

clone with --force arg

Open alexzanderr opened this issue 3 years ago • 5 comments

im trying to clone a repo by force into an existing one

            let repo = Repository::clone(
                package_template_repo_url,
                clone_destination.clone(),
            );

apparently there is no args method for builder pattern.

how can i specify arguments to clone method ?

such as:

  • force ? does this exist ?
  • --branch
  • --depth and many more

alexzanderr avatar Mar 24 '22 17:03 alexzanderr

You can use RepoBuilder to control the clone options (FetchOptions, CheckoutBuilder, etc.). libgit2 does not support shallow clones, though.

ehuss avatar Mar 24 '22 18:03 ehuss

yeah. but that example is very minimal ...

alexzanderr avatar Mar 24 '22 23:03 alexzanderr

thats all the documentation for that ? ...

alexzanderr avatar Mar 24 '22 23:03 alexzanderr

That is the documentation available. Is there something that seems to be missing? The FetchOptions and CheckoutBuilder contains documentation for each option.

ehuss avatar Mar 25 '22 17:03 ehuss

okey, i'll read the docs and come back later.

alexzanderr avatar Mar 28 '22 09:03 alexzanderr