Skip to content
jlee-tessik edited this page Jun 11, 2015 · 5 revisions

git-clone

Clone a repository into a new directory

####Git

$ git clone https://github.com/libgit2/libgit2sharp.git
```
#### LibGit2Sharp
```csharp
Repository.Clone("https://github.com/libgit2/libgit2sharp.git", "path/to/repo");
```
To provide a username and password, pass in CloneOptions.
```csharp
var co = new CloneOptions();
co.CredentialsProvider = (_url, _user, _cred) => new UsernamePasswordCredentials { Username = "Username", Password = "Password" };
Repository.Clone("https://github.com/libgit2/libgit2sharp.git", "path/to/repo", co);
```

Clone this wiki locally