SkillAgentSearch skills...

PHPGit

A Git wrapper for PHP5.3+

Install / Use

/learn @kzykhys/PHPGit
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

PHPGit - A Git wrapper for PHP5.3+

Latest Unstable Version Build Status Coverage Status SensioLabsInsight

Requirements

  • PHP5.3
  • Git

Installation

Update your composer.json and run composer update

{
    "require": {
        "kzykhys/git": "dev-master"
    }
}

Basic Usage

<?php

require __DIR__ . '/vendor/autoload.php';

$git = new PHPGit\Git();
$git->clone('https://github.com/kzykhys/PHPGit.git', '/path/to/repo');
$git->setRepository('/path/to/repo');
$git->remote->add('production', 'git://example.com/your/repo.git');
$git->add('README.md');
$git->commit('Adds README.md');
$git->checkout('release');
$git->merge('master');
$git->push();
$git->push('production', 'release');
$git->tag->create('v1.0.1', 'release');

foreach ($git->tree('release') as $object) {
    if ($object['type'] == 'blob') {
        echo $git->show($object['file']);
    }
}

API

Git commands

  • git add
    • $git->add(string|array|\Traversable $file, array $options = [])
  • git archive
    • $git->archive(string $file, string $tree = null, string|array|\Traversable $path = null, array $options = [])
  • git branch
    • $git->branch(array $options = [])
    • $git->branch->create(string $branch, string $startPoint = null, array $options = [])
    • $git->branch->move(string $branch, string $newBranch, array $options = [])
    • $git->branch->delete(string $branch, array $options = [])
  • git cat-file
    • $git->cat->blob(string $object)
    • $git->cat->type(string $object)
    • $git->cat->size(string $object)
  • git checkout
    • $git->checkout(string $branch, array $options = [])
    • $git->checkout->create(string $branch, string $startPoint = null, array $options = [])
    • $git->checkout->orphan(string $branch, string $startPoint = null, array $options = [])
  • git clone
    • $git->clone(string $repository, string $path = null, array $options = [])
  • git commit
    • $git->commit(string $message, array $options = [])
  • git config
    • $git->config(array $options = [])
    • $git->config->set(string $name, string $value, array $options = [])
    • $git->config->add(string $name, string $value, array $options = [])
  • git describe
    • $git->describe(string $committish = null, array $options = [])
    • $git->describe->tags(string $committish = null, array $options = [])
  • git fetch
    • $git->fetch(string $repository, string $refspec = null, array $options = [])
    • $git->fetch->all(array $options = [])
  • git init
    • $git->init(string $path, array $options = [])
  • git log
    • $git->log(string $revRange = '', string $path = null, array $options = [])
  • git merge
    • $git->merge(string|array|\Traversable $commit, string $message = null, array $options = [])
    • $git->merge->abort()
  • git mv
    • $git->mv(string|array|\Iterator $source, string $destination, array $options = [])
  • git pull
    • $git->pull(string $repository = null, string $refspec = null, array $options = [])
  • git push
    • $git->push(string $repository = null, string $refspec = null, array $options = [])
  • git rebase
    • $git->rebase(string $upstream = null, string $branch = null, array $options = [])
    • $git->rebase->continues()
    • $git->rebase->abort()
    • $git->rebase->skip()
  • git remote
    • $git->remote()
    • $git->remote->add(string $name, string $url, array $options = [])
    • $git->remote->rename(string $name, string $newName)
    • $git->remote->rm(string $name)
    • $git->remote->show(string $name)
    • $git->remote->prune(string $name = null)
    • $git->remote->head(string $name, string $branch = null)
    • $git->remote->head->set(string $name, string $branch)
    • $git->remote->head->delete(string $name)
    • $git->remote->head->remote(string $name)
    • $git->remote->branches(string $name, array $branches)
    • $git->remote->branches->set(string $name, array $branches)
    • $git->remote->branches->add(string $name, array $branches)
    • $git->remote->url(string $name, string $newUrl, string $oldUrl = null, array $options = [])
    • $git->remote->url->set(string $name, string $newUrl, string $oldUrl = null, array $options = [])
    • $git->remote->url->add(string $name, string $newUrl, array $options = [])
    • $git->remote->url->delete(string $name, string $url, array $options = [])
  • git reset
    • $git->reset(string|array|\Traversable $paths, string $commit = null)
    • $git->reset->soft(string $commit = null)
    • $git->reset->mixed(string $commit = null)
    • $git->reset->hard(string $commit = null)
    • $git->reset->merge(string $commit = null)
    • $git->reset->keep(string $commit = null)
    • $git->reset->mode(string $mode, string $commit = null)
  • git rm
    • $git->rm(string|array|\Traversable $file, array $options = [])
    • $git->rm->cached(string|array|\Traversable $file, array $options = [])
  • git shortlog
    • $git->shortlog(string|array|\Traversable $commits = HEAD)
    • $git->shortlog->summary(string $commits = HEAD)
  • git show
    • $git->show(string $object, array $options = [])
  • git stash
    • $git->stash()
    • $git->stash->save(string $message = null, array $options = [])
    • $git->stash->lists(array $options = [])
    • $git->stash->show(string $stash = null)
    • $git->stash->drop(string $stash = null)
    • $git->stash->pop(string $stash = null, array $options = [])
    • $git->stash->apply(string $stash = null, array $options = [])
    • $git->stash->branch(string $name

Related Skills

View on GitHub
GitHub Stars178
CategoryDevelopment
Updated1y ago
Forks47

Languages

PHP

Security Score

65/100

Audited on Dec 5, 2024

No findings