Call to undefined method CzProject\GitPhp\Git::fetch() #93
-
Hello, I'm experimenting with this tool and I'm kind of having problems, I'm unable to figure out why, but I'm unable to do a Git::Fetch() in my codebase. I am running Laravel 10, Php 8.1, and I have the latest version of CzProject\GitPhp. The error is
and the code is:
Again I am just experimenting with it, so maybe it's wrong, I'm trying to figure it out for a larger project. Does anyone know what's going on? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, this is correct error, there is no method $git = new Git;
// Collect Repositories
$repositories = repository::all();
// Fetch each repository
foreach ($repositories as $repository) {
// Create a new GitPhp instance
$repo = $git->open($pathToRepository);
// Fetch the repository
$repo->fetch();
// echo it out
echo "Updated " . $repository->name . "\n";
} |
Beta Was this translation helpful? Give feedback.
Hi, this is correct error, there is no method
CzProject\GitPhp\Git::fetch()
- you must call this method onCzProject\GitPhp\GitRepository
instance, for example: