Property | Type | Description | |
---|---|---|---|
$repositoryDir | string | ||
$shellHelper | Platformsh\Cli\Helper\ShellHelperInterface |
Method | Description | |
---|---|---|
__construct ( Platformsh\Cli\Helper\ShellHelperInterface $shellHelper = null ) | Constructor. | |
branchExists ( string $branchName, string $dir = null, boolean $mustRun = false ) : boolean | Check whether a branch exists. | |
checkOut ( string $name, string | null $dir = null, boolean $mustRun = false, boolean $quiet = false ) : boolean | Check out a branch. | |
checkOutNew ( string $name, string | null $parent = null, string | null $upstream = null, string | null $dir = null, boolean $mustRun = false ) : boolean | Create a new branch and check it out. | |
cloneRepo ( string $url, string $destination = null, array $args = [], boolean $mustRun = false ) : boolean | Clone a repository. | |
ensureInstalled ( ) | Ensure that the Git CLI is installed. | |
execute ( array $args, string | false $dir = null, boolean $mustRun = false, boolean $quiet = true ) : string | boolean | Execute a Git command. | |
fetch ( string $remote, string | null $branch = null, string | null $dir = null, boolean $mustRun = false ) : boolean | Fetch from the Git remote. | |
getConfig ( string $key, string | null $dir = null, boolean $mustRun = false ) : string | false | Read a configuration item. | |
getCurrentBranch ( string $dir = null, boolean $mustRun = false ) : string | false | Get the current branch name. | |
getMergedBranches ( string $ref = 'HEAD', boolean $remote = false, null $dir = null, boolean $mustRun = false ) : string[] | Get a list of branches merged with a specific ref. | |
getName ( ) | ||
getRoot ( string | null $dir = null, boolean $mustRun = false ) : string | false | Find the root of a directory in a Git repository. | |
getUpstream ( string $branch = null, string | null $dir = null, boolean $mustRun = false ) : string | false | Get the upstream for a branch. | |
getVersion ( ) : string | false | Get the installed version of the Git CLI. | |
init ( string $dir, boolean $mustRun = false ) : boolean | Create a Git repository in a directory. | |
remoteBranchExists ( string $remote, string $branchName, null $dir = null, boolean $mustRun = false ) : boolean | Check whether a branch exists on a remote. | |
remoteRepoExists ( string $url ) : boolean | Check whether a remote repository exists. | |
setDefaultRepositoryDir ( string $dir ) | Set the repository directory. | |
setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) | ||
setUpstream ( string | false $upstream, string | null $dir = null, boolean $mustRun = false ) : boolean | Set the upstream for the current branch. | |
supportsShallowClone ( ) : boolean | ||
updateSubmodules ( boolean $recursive = false, string | null $dir = null, boolean $mustRun = false ) : boolean | Update and/or initialize submodules. |
public __construct ( Platformsh\Cli\Helper\ShellHelperInterface $shellHelper = null ) | ||
$shellHelper | Platformsh\Cli\Helper\ShellHelperInterface |
public checkOutNew ( string $name, string | null $parent = null, string | null $upstream = null, string | null $dir = null, boolean $mustRun = false ) : boolean | ||
$name | string | |
$parent | string | null | |
$upstream | string | null | |
$dir | string | null | The path to a Git repository. |
$mustRun | boolean | Enable exceptions if the Git command fails. |
return | boolean |
public cloneRepo ( string $url, string $destination = null, array $args = [], boolean $mustRun = false ) : boolean | ||
$url | string | The Git repository URL. |
$destination | string | A directory name to clone into. |
$args | array | Extra arguments for the Git command. |
$mustRun | boolean | Enable exceptions if the Git command fails. |
return | boolean |
public execute ( array $args, string | false $dir = null, boolean $mustRun = false, boolean $quiet = true ) : string | boolean | ||
$args | array | Command arguments (everything after 'git'). |
$dir | string | false | The path to a Git repository. Set to false if the command should not run inside a repository. |
$mustRun | boolean | Enable exceptions if the Git command fails. |
$quiet | boolean | Suppress command output. |
return | string | boolean | The command output, true if there is no output, or false if the command fails. |
public getUpstream ( string $branch = null, string | null $dir = null, boolean $mustRun = false ) : string | false | ||
$branch | string | The name of the branch to get the upstream for. Defaults to the current branch. |
$dir | string | null | The path to a Git repository. |
$mustRun | boolean | Enable exceptions if the Git command fails. |
return | string | false | The upstream, in the form remote/branch, or false if no upstream is found. |
public getVersion ( ) : string | false | ||
return | string | false | The version number, or false on failure. |
public remoteRepoExists ( string $url ) : boolean | ||
$url | string | |
return | boolean |
public setDefaultRepositoryDir ( string $dir ) | ||
$dir | string | The path to a Git repository. |
public setOutput ( Symfony\Component\Console\Output\OutputInterface $output ) | ||
$output | Symfony\Component\Console\Output\OutputInterface |
public setUpstream ( string | false $upstream, string | null $dir = null, boolean $mustRun = false ) : boolean | ||
$upstream | string | false | The upstream name, or false to unset the upstream. |
$dir | string | null | The path to a Git repository. |
$mustRun | boolean | Enable exceptions if the Git command fails. |
return | boolean |
public updateSubmodules ( boolean $recursive = false, string | null $dir = null, boolean $mustRun = false ) : boolean | ||
$recursive | boolean | Whether to recurse into nested submodules. |
$dir | string | null | The path to a Git repository. |
$mustRun | boolean | Enable exceptions if the Git command fails. |
return | boolean |