Use the interface: ArtARTs36\GitHandler\Contracts\Commands\GitPushCommand
use \ArtARTs36\GitHandler\Factory\LocalGitFactory;
$command = (new LocalGitFactory())->factory(__DIR__)->pushes();
public function push(bool $force = false, ?string $upStream = null): bool;
git push
git push --force
git push --force set-upstream $upStream
use \ArtARTs36\GitHandler\Factory\LocalGitFactory;
(new LocalGitFactory())->factory(__DIR__)->pushes()->push(true, 'upStream-test');
public function pushOnAutoSetUpStream(bool $force = false): bool;
git push --set-upstream origin {current-branch}
use \ArtARTs36\GitHandler\Factory\LocalGitFactory;
(new LocalGitFactory())->factory(__DIR__)->pushes()->pushOnAutoSetUpStream(true);
public function pushAllTags(bool $force = false, ?string $upStream = null): bool;
git push --tags
use \ArtARTs36\GitHandler\Factory\LocalGitFactory;
(new LocalGitFactory())->factory(__DIR__)->pushes()->pushAllTags(true, 'upStream-test');
public function send(callable $making): void;
git push (opts and args from $making)
use \ArtARTs36\GitHandler\Factory\LocalGitFactory;
(new LocalGitFactory())->factory(__DIR__)->pushes()->send(function (\ArtARTs36\GitHandler\Making\MakingPush $push) {
$push
->onRemote(function (\Psr\Http\Message\UriInterface $uri) {
return $uri->withUserInfo('artarts36', 'ghp_my_github_token');
})
->onBranchHead('dev')
->force();
});