Administration class for Git repositories.

CloneableInstantiable
Methods
public static cloneBranchTo( $path, $url, $branch, $bare = true, $options = [])
 

Clone a repository branch to a local path.

public static cloneRepository( $path, $url, array $args = [], array $options = [])
 

Internal method to launch effective `git clone` command.

public static cloneTo( $path, $url, $bare = true, array $options = [])
 

Clone a repository to a local path.

public static init( $path, $bare = true, array $options = [])
 

Initializes a repository and returns the instance.

public static isValidRepository( $url, array $options = [])
 

Checks the validity of a git repository url without cloning it.

This will use the ls-remote command of git against the given url.
Usually, this command returns 0 when successful, and 128 when the
repository is not found.

  • return bool true if url is valid
public static mirrorTo( $path, $url, array $options = [])
 

Mirrors a repository (fetch all revisions, not only branches).

Methods
private static getProcess( $command, array $args = [], array $options = [])
 

This internal method is used to create a process object.

Methods
public static cloneBranchTo( $path, $url, $branch, $bare = true, $options = [])
 

Clone a repository branch to a local path.

public static cloneRepository( $path, $url, array $args = [], array $options = [])
 

Internal method to launch effective `git clone` command.

public static cloneTo( $path, $url, $bare = true, array $options = [])
 

Clone a repository to a local path.

private static getProcess( $command, array $args = [], array $options = [])
 

This internal method is used to create a process object.

public static init( $path, $bare = true, array $options = [])
 

Initializes a repository and returns the instance.

public static isValidRepository( $url, array $options = [])
 

Checks the validity of a git repository url without cloning it.

This will use the ls-remote command of git against the given url.
Usually, this command returns 0 when successful, and 128 when the
repository is not found.

  • return bool true if url is valid
public static mirrorTo( $path, $url, array $options = [])
 

Mirrors a repository (fetch all revisions, not only branches).

© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only