-1

hi i want to download a directory from github account how can i do this? for example i want to download manifest folder from test acount:

github.com/test/projectx/manifest

I don't want to use github API as much as possible but I tested Octokit It's like taking the folder as a byte, but I couldn't turn it into a folder on my system

 var archiveBytes = await client.Repository.Content.GetArchive("octokit", "octokit.net", ArchiveFormat.Zipball);
davod kh
  • 23
  • 4

2 Answers2

2

If you are looking for a way to clone repository to your local machine you can do as follow.

You will want to use LibGit2Sharp library, You can install it using:

NuGet Package Manager (Visual Studio) NuGet link

Install-Package LibGit2Sharp

-or-

.NET Core CLI

dotnet add package LibGit2Sharp

Then simply use:

Repository.Clone("https://github.com/EdiWang/EnvSetup.git", @"D:\EnvSetup");

For more details see: Operate git with net core

DavidDr90
  • 559
  • 5
  • 20
-3

Do you need to download it on an application or juste in another folder ? In this case you can click the "download or clone" button on the github respository, download the zip and extract the file you want then open them in your IDE. Otherwise you can use the git command

cd /yourWorkingDirectory
git init
git clone
git status

then you'll be able to acess all the files of the github's directory in your WorkingDirectory.

I hope this will help you.

gabriel
  • 50
  • 2