Final Class Yiisoft\YiiDevTool\App\Component\Git\GitWorkingCopy
| Inheritance | Yiisoft\YiiDevTool\App\Component\Git\GitWorkingCopy |
|---|
Public Methods
Method Details
| public mixed __construct ( string $gitBinary, string $directory ) | ||
| $gitBinary | string | |
| $directory | string | |
public function __construct(
private string $gitBinary,
private string $directory,
) {
}
| public string branch ( mixed $argsOrOptions ) | ||
| $argsOrOptions | mixed | |
public function branch(mixed ...$argsOrOptions): string
{
return $this->run('branch', $argsOrOptions);
}
| public string checkout ( mixed $argsOrOptions ) | ||
| $argsOrOptions | mixed | |
public function checkout(mixed ...$argsOrOptions): string
{
return $this->run('checkout', $argsOrOptions);
}
| public string checkoutNewBranch ( string $branch ) | ||
| $branch | string | |
public function checkoutNewBranch(string $branch): string
{
return $this->checkout(['b' => true], $branch);
}
| public string clean ( string $argsOrOptions ) | ||
| $argsOrOptions | string | |
public function clean(string ...$argsOrOptions): string
{
return $this->run('clean', $argsOrOptions);
}
| public string commit ( mixed $argsOrOptions ) | ||
| $argsOrOptions | mixed | |
public function commit(mixed ...$argsOrOptions): string
{
if (isset($argsOrOptions[0]) && is_string($argsOrOptions[0]) && !isset($argsOrOptions[1])) {
$argsOrOptions[0] = [
'a' => true,
'm' => $argsOrOptions[0],
];
}
return $this->run('commit', $argsOrOptions);
}
| public Yiisoft\YiiDevTool\App\Component\Git\GitBranches getBranches ( ) |
public function getBranches(): GitBranches
{
return new GitBranches($this);
}
| public string getRemoteUrl ( string $remote, string $operation = 'fetch' ) | ||
| $remote | string | |
| $operation | string | |
public function getRemoteUrl(string $remote, string $operation = 'fetch'): string
{
$arguments = ['get-url'];
if ($operation === 'push') {
$arguments[] = '--push';
}
$arguments[] = $remote;
return trim($this->run('remote', $arguments));
}
| public string getStatus ( ) |
public function getStatus(): string
{
return $this->run('status', ['-s']);
}
| public boolean hasChanges ( ) |
public function hasChanges(): bool
{
return $this->getStatus() !== '';
}
| public string pull ( mixed $argsOrOptions ) | ||
| $argsOrOptions | mixed | |
public function pull(mixed ...$argsOrOptions): string
{
return $this->run('pull', $argsOrOptions);
}
| public string push ( mixed $argsOrOptions ) | ||
| $argsOrOptions | mixed | |
public function push(mixed ...$argsOrOptions): string
{
return $this->run('push', $argsOrOptions);
}
| public string pushTag ( string $tag, string $repository = 'origin' ) | ||
| $tag | string | |
| $repository | string | |
public function pushTag(string $tag, string $repository = 'origin'): string
{
return $this->push($repository, 'tag', $tag);
}
| public string reset ( mixed $argsOrOptions ) | ||
| $argsOrOptions | mixed | |
public function reset(mixed ...$argsOrOptions): string
{
return $this->run('reset', $argsOrOptions);
}
| public string run ( string $command, array $argsOrOptions = [] ) | ||
| $command | string | |
| $argsOrOptions | array | |
public function run(string $command, array $argsOrOptions = []): string
{
return $this->runCommand($command, $argsOrOptions);
}
| public string runWithOutput ( string $command, array $argsOrOptions, callable $callback ) | ||
| $command | string | |
| $argsOrOptions | array | |
| $callback | callable | |
public function runWithOutput(string $command, array $argsOrOptions, callable $callback): string
{
return $this->runCommand($command, $argsOrOptions, $callback);
}
Signup or Login in order to comment.