-
Hello, is there a way to get the getRemoteBranches from a remote repo without cloning it locally?
But this return :
Any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Answered by
janpecha
Sep 8, 2022
Replies: 1 comment 2 replies
-
Hello! I see two options: 1) Use empty local repository $git = new CzProject\GitPhp\Git;
$repo = $git->init(__DIR__ . '/empty-repo');
$repo->addRemote('origin', 'https://github.com/czproject/git-php');
var_dump($repo->execute('ls-remote', '--heads', 'origin')); 2) Use CliRunner directly and run command $runner = new CzProject\GitPhp\Runners\CliRunner;
var_dump($runner->run(__DIR__, ['ls-remote', '--heads', 'https://github.com/czproject/git-php'])->getOutput()); |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ahmed-bhs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
I see two options:
1) Use empty local repository
2) Use CliRunner directly and run command
ls-remote
manually