Using LibGit2Sharp, I can do a clone from a specific remote branch :). Now, I want to clone a repo from a specif tag, say "v1". I found this link but it does not help me. how to clone specific tag using git_clone() in libgit2
I thought I might be able to specifiy the tag with CloneOptions.BranchName (I know this is for a branch but I thought I should try anyway before posting my question) but it did not succeed. Here's the C# code I have.
var co = new CloneOptions();
co.BranchName = "v1"; // "refs/tags/v1" does not work either
co.CredentialsProvider = (_url, _user, _cred) => new UsernamePasswordCredentials { Username = "username", Password = "password" };
Repository.Clone(repoUrl, localGitPath, co);
Is it possible to clone from a specific tag?