Skip to content

Latest commit

 

History

History
48 lines (34 loc) · 1.06 KB

commits.md

File metadata and controls

48 lines (34 loc) · 1.06 KB

Commits

Retrieve and compare information about commits.

Prepare:

$commits = new Bitbucket\API\Repositories\Commits();
$commits->setCredentials(new Http\Message\Authentication\BasicAuth($bb_user, $bb_pass));

Get all commits for a repository: (API 2.0)

$commits->all($account_name, $repo_slug);

Get all commits for a single branch: (API 2.0)

$commits->all($account_name, $repo_slug, array(
    'branch' => 'master' // this can also be a tag
));

Get an individual commit: (API 2.0)

$commits->get($account_name, $repo_slug, $commitSHA1);

Approve a commit: (API 2.0)

$commits->approve($account_name, $repo_slug, $commitSHA1);

Delete a commit approval: (API 2.0)

$commits->deleteApproval($account_name, $repo_slug, $commitSHA1);

Related: