Home > OS >  Is there any way to install and unpack a github repository through code without using git bash and t
Is there any way to install and unpack a github repository through code without using git bash and t

Time:11-08

Currently I have a problem where I need to install all contents of a github repository (https://github.com/reversinglabs/reversinglabs-yara-rules) through code without using git bash or the like. In this case I need to fully install the yara repository from said github. Any one knows a way to do it in c,c ,c#,python?

Unfortunately till now I have yet to succeed in any way.

CodePudding user response:

It's not clear what part of bash, etc, you do not want to use. A simple way otherwise is to just call git through std::system()

#include <cstdlib>

int main(int argc, char**argv) {
    std::system("git clone ...");
}

I have used it in many cases where I need to integrate git commands in a c program.

CodePudding user response:

GitHub offers a zip download of all the code it hosts. Use whatever language and library you like to do the equivalent of:

curl -o yara-rules.zip https://github.com/reversinglabs/reversinglabs-yara-rules/archive/refs/heads/develop.zip 
unzip yara-rules.zip
  • Related