Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 660 Bytes

git_transaction.md

File metadata and controls

37 lines (23 loc) · 660 Bytes

Git Transactions

Use the interface: ArtARTs36\GitHandler\Contracts\Transaction\GitTransaction


Create Instance

use \ArtARTs36\GitHandler\Factory\LocalGitFactory;

$command = (new LocalGitFactory())->factory(__DIR__)->transaction();

Features:

* Execute transaction

Method Signature:

public function attempt(callable $callback): mixed;

Example:

use \ArtARTs36\GitHandler\Factory\LocalGitFactory;

(new LocalGitFactory())->factory(__DIR__)->transaction()->attempt(function (GitHandler $git) {
    $git->merges()->merge('master');
});