class Git

Git Interface Class

This class enables the creating, reading, and manipulation of git repositories.

Properties

static protected string $bin Git executable location

Methods

static 
set_bin(string $path)

Sets git executable path

static 
get_bin()

Gets git executable path

static 
windows_mode()

Sets up library for use in a default Windows environment

static GitRepo
create(string $repo_path, string $source = null)

Create a new git repository

static GitRepo
open(string $repo_path)

Open an existing git repository

static GitRepo
clone_remote(string $repo_path, string $remote, string $reference = null)

Clones a remote repo into a directory and then returns a GitRepo object for the newly created local repo

static bool
is_repo(mixed $var)

Checks if a variable is an instance of GitRepo

Details

at line 43
static set_bin(string $path)

Sets git executable path

Parameters

string $path executable location

at line 50
static get_bin()

Gets git executable path

at line 57
static windows_mode()

Sets up library for use in a default Windows environment

at line 71
static GitRepo create(string $repo_path, string $source = null)

Create a new git repository

Accepts a creation path, and, optionally, a source path

Parameters

string $repo_path repository path
string $source directory to source

Return Value

GitRepo

at line 84
static GitRepo open(string $repo_path)

Open an existing git repository

Accepts a repository path

Parameters

string $repo_path repository path

Return Value

GitRepo

at line 100
static GitRepo clone_remote(string $repo_path, string $remote, string $reference = null)

Clones a remote repo into a directory and then returns a GitRepo object for the newly created local repo

Accepts a creation path and a remote to clone from

Parameters

string $repo_path repository path
string $remote remote source
string $reference reference path

Return Value

GitRepo

at line 113
static bool is_repo(mixed $var)

Checks if a variable is an instance of GitRepo

Accepts a variable

Parameters

mixed $var variable

Return Value

bool