Skip to content

Call to undefined method CzProject\GitPhp\Git::fetch() #93

Answered by janpecha
Lexian-droid asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, this is correct error, there is no method CzProject\GitPhp\Git::fetch() - you must call this method on CzProject\GitPhp\GitRepository instance, for example:

$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";
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Lexian-droid
Comment options

Answer selected by Lexian-droid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants