Overview

Namespaces

  • Cz
    • Git

Classes

  • GitRepository

Interfaces

  • IGit

Exceptions

  • GitException
  • Overview
  • Namespace
  • Class

Class GitRepository

Cz\Git\GitRepository implements Cz\Git\IGit
Namespace: Cz\Git
Located at GitRepository.php
Methods summary
public
# __construct( $repository )
public string
# getRepositoryPath( )

Returns

string
public Cz\Git\GitRepository
# createTag( string $name )

Creates a tag. git tag <name>

Creates a tag. git tag <name>

Parameters

$name

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::createTag()
public Cz\Git\GitRepository
# removeTag( string $name )

Removes tag. git tag -d <name>

Removes tag. git tag -d <name>

Parameters

$name

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::removeTag()
public Cz\Git\GitRepository
# renameTag( string $oldName, string $newName )

Renames tag. git tag <new> <old> git tag -d <old>

Renames tag. git tag <new> <old> git tag -d <old>

Parameters

$oldName
$newName

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::renameTag()
public string[]|null
# getTags( )

Returns list of tags in repo.

Returns list of tags in repo.

Returns

string[]|null
NULL => no tags

Implementation of

Cz\Git\IGit::getTags()
public Cz\Git\GitRepository
# merge( string $branch, array|null $options = NULL )

Merges branches. git merge <options> <name>

Merges branches. git merge <options> <name>

Parameters

$branch
$options

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::merge()
public Cz\Git\GitRepository
# createBranch( string $name, boolean $checkout = FALSE )

Creates new branch. git branch <name> (optionaly) git checkout <name>

Creates new branch. git branch <name> (optionaly) git checkout <name>

Parameters

$name
$checkout

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::createBranch()
public Cz\Git\GitRepository
# removeBranch( string $name )

Removes branch. git branch -d <name>

Removes branch. git branch -d <name>

Parameters

$name

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::removeBranch()
public string
# getCurrentBranchName( )

Gets name of current branch git branch + magic

Gets name of current branch git branch + magic

Returns

string

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::getCurrentBranchName()
public string[]|null
# getBranches( )

Returns list of branches in repo.

Returns list of branches in repo.

Returns

string[]|null
NULL => no branches

Implementation of

Cz\Git\IGit::getBranches()
public Cz\Git\GitRepository
# checkout( string $name )

Checkout branch. git checkout <branch>

Checkout branch. git checkout <branch>

Parameters

$name

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::checkout()
public Cz\Git\GitRepository
# removeFile( string|string[] $file )

Removes file(s). git rm <file>

Removes file(s). git rm <file>

Parameters

$file

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::removeFile()
public Cz\Git\GitRepository
# addFile( string|string[] $file )

Adds file(s). git add <file>

Adds file(s). git add <file>

Parameters

$file

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::addFile()
public Cz\Git\GitRepository
# renameFile( string|string[] $file, string|null $to = NULL )

Renames file(s). git mv <file>

Renames file(s). git mv <file>

Parameters

$file
array('from' => 'to', ...) || (from, to)
$to

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::renameFile()
public Cz\Git\GitRepository
# commit( string $message, string[] $params = NULL )

Commits changes git commit <params> -m <message>

Commits changes git commit <params> -m <message>

Parameters

$message
$params
=> value

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException

Implementation of

Cz\Git\IGit::commit()
public boolean
# isChanges( )

Exists changes? git status + magic

Exists changes? git status + magic

Returns

boolean

Implementation of

Cz\Git\IGit::isChanges()
protected Cz\Git\GitRepository
# run( string|array $cmd )

Runs command.

Runs command.

Parameters

$cmd

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException
public static Cz\Git\GitRepository
# init( string $directory )

Init repo in directory

Init repo in directory

Parameters

$directory

Returns

Cz\Git\GitRepository

Throws

Cz\Git\GitException
czproject/git-php version-2 API documentation API documentation generated by ApiGen