NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages
Git for Laravel

Feature detection

Branch on the capability matrix instead of catching FeatureNotSupportedException:

use RoundlyConsulting\Git\Enums\Feature;
use RoundlyConsulting\Git\Enums\ProviderName;

$github = Git::github();

if ($github->supports(Feature::ListCommits)) {
    $github->repo('acme/api')->commits()->get();
}

$github->supportsAll(Feature::CreateRelease, Feature::CreateTag); // bool
$github->supportsAny(Feature::Languages);                         // bool
$github->features();                                              // list<Feature> this provider supports
$github->capabilities();                                          // ['repositories' => true, ...]
$github->featureMatrix();                                         // list<FeatureInfo> with ->supported
Git::capabilities(ProviderName::Bitbucket);                       // without authenticating
Feature::MergePullRequest->description();                         // "Merge a pull/merge request."

Capability matrix

FeatureGitHubGitLabBitbucket
ListRepositories, FindRepository, ListCommits, FindCommit, ListRepositoryBranchesYesYesYes
ListPullRequests, FindPullRequestYesYesYes
ListIssues, FindIssueYesYesNo
ListTags, ListReleases, FindReleaseYesYesNo
FileContents, Compare, ListContributors, Languages, SearchRepositoriesYesYesNo
CreateRepositoryYesYesYes
GenerateFromTemplateYesNoNo
CreateBranch, CreateFile, UpdateFileYesYesNo
CreatePullRequest, CreateCommentYesYesYes
ClosePullRequest, ApprovePullRequest, ReviewPullRequest, ListPullRequestReviews, MergePullRequestYesNoNo
CreateRelease, CreateTagYesYesNo
CreateWebhook, DeleteWebhook, ListWebhooksYesYesYes
FindInstallation, ListInstallations, ListInstallationRepositoriesYesNoNo

Git::capabilities() answers without authenticating, so you can render a provider picker before a user has connected anything.

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.