PhpGit - A Git wrapper for PHP 7.1+

Related tags

Miscellaneous phpgit
Overview

PhpGit

GitHub tag (latest SemVer) Github Actions Status Php Version

PhpGit - A Git wrapper for PHP 7.1+

The project is forked from https://github.com/kzykhys/PHPGit

Requirements

  • PHP 7.1+
  • Git

Installation

Update your composer.json and run composer update

{
    "require": {
        "phppkg/phpgit": "dev-master"
    }
}

Basic Usage

<?php

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

$git = PhpGit\Git::new();
$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']);
    }
}

Git Info

$repo = PhpGit\Repo::new('/path/to/repo');

$remotes = $repo->getRemotes();

$url  = $repo->getRemoteUrl('origin');
$info = $repo->getRemoteInfo('origin');

var_dump($info);

Output:

object(PhpGit\Info\RemoteInfo)#35 (8) {
  ["type"]=> string(4) "http"
  ["name"]=> string(6) "origin"
  ["url"]=> string(34) "https://github.com/phppkg/phpgit.git"
  ["scheme"]=> string(5) "https"
  ["host"]=> string(10) "github.com"
  ["path"]=> string(11) "phppkg/phpgit"
  ["group"]=> string(4) "ulue"
  ["repo"]=> string(6) "phpgit"
}

Changelog

Provide quick generate formatted changelog.

Formatter

  • SimpleFormatter
  • MarkdownFormatter
  • GithubReleaseFormatter

Filter

  • KeywordFilter
  • KeywordsFilter
  • MsgLenFilter
  • WordsLenFilter

Example

use Toolkit\Cli\Color;
use PhpGit\Changelog\Formatter\GithubReleaseFormatter;
use PhpGit\Changelog\Formatter\SimpleFormatter;
use PhpGit\Changelog\GitChangeLog;

// this is built in log format.
// you can custom format string, but must be set an log parser by $gcl->setLineParser(new YourLineParser);
$logFormat = GitChangeLog::LOG_FMT_HSC;

$oldVersion = 'v0.2.1';
$newVersion = 'HEAD';

// get output by git log cmd:
//  `git log v0.2.1...HEAD --reverse --pretty=format:"%H | %s | %cn" --no-merges`
$c = PhpGit\Git::new()->newCmd('log');
$c->add("$oldVersion...$newVersion");
$c->add('--reverse');
$c->addf('--pretty=format:"%s"', $logFormat);

// get repo url
$info = PhpGit\Repo::new()->getRemoteInfo('origin');
$repoUrl = $info->getHttpUrl();
Color::info('repo URL: ' . $repoUrl);

// create object by output.
$gcl = GitChangeLog::new($c->getOutput());
$gcl->setLogFormat($logFmt);
$gcl->setRepoUrl($repoUrl);

// you can set output style. default is markdown.
// can also, you can custom your item formatter
$gcl->setItemFormatter(new GithubReleaseFormatter());
//$gcl->setItemFormatter(new SimpleFormatter());

Color::info('parse logs and generate changelog');

// parse and generate.
$str = $gcl->generate();

echo $str;

will see:

> git log v0.2.1...HEAD --reverse --pretty=format:"%H | %s | %cn" --no-merges
> git remote -v
[INFO] repo URL:https://github.com/phppkg/phpgit
[INFO] parse logs and generate changelog

### Fixed

 - fix get latest tag error on windows https://github.com/phppkg/phpgit/commit/b9892b0ec363e405fcb76b08ea971fb651b4d2dc

### Update

 - up: rename package org to phppkg https://github.com/phppkg/phpgit/commit/990e55c6beddf654819c323c2a18d329074399f9
 - update some info https://github.com/phppkg/phpgit/commit/"1110de8b5ef0406c837bcd65f607b6f9483c9154

### Feature

 - feat: add util for quick generate change log https://github.com/phppkg/phpgit/commit/50962c12d3f16cdbbd8c1f21bc17ff920842365e

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, string $stash = null)
    • $git->stash->clear()
    • $git->stash->create()
  • git status
    • $git->status(array $options = [])
  • git tag
    • $git->tag()
    • $git->tag->create(string $tag, string $commit = null, array $options = [])
    • $git->tag->delete(string|array|\Traversable $tag)
    • $git->tag->verify(string|array|\Traversable $tag)
  • git ls-tree
    • $git->tree(string $branch = master, string $path = '')

git add

$git->add(string|array|\Traversable $file, array $options = [])

Add file contents to the index

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->add('file.txt');
$git->add('file.txt', ['force' => false, 'ignore-errors' => false);
Options
  • force (boolean) Allow adding otherwise ignored files
  • ignore-errors (boolean) Do not abort the operation

git archive

$git->archive(string $file, string $tree = null, string|array|\Traversable $path = null, array $options = [])

Create an archive of files from a named tree

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->archive('repo.zip', 'master', null, ['format' => 'zip']);
Options
  • format (boolean) Format of the resulting archive: tar or zip
  • prefix (boolean) Prepend prefix/ to each filename in the archive

git branch

$git->branch(array $options = [])

Returns an array of both remote-tracking branches and local branches

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$branches = $git->branch();
Output Example
[
    'master' => ['current' => true, 'name' => 'master', 'hash' => 'bf231bb', 'title' => 'Initial Commit'],
    'origin/master' => ['current' => false, 'name' => 'origin/master', 'alias' => 'remotes/origin/master']
]
Options
  • all (boolean) List both remote-tracking branches and local branches
  • remotes (boolean) List the remote-tracking branches

$git->branch->create(string $branch, string $startPoint = null, array $options = [])

Creates a new branch head named $branch which points to the current HEAD, or $startPoint if given

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->branch->create('bugfix');              // from current HEAD
$git->branch->create('patch-1', 'a092bf7s'); // from commit
$git->branch->create('1.0.x-fix', 'v1.0.2'); // from tag
Options
  • force (boolean) Reset $branch to $startPoint if $branch exists already

$git->branch->move(string $branch, string $newBranch, array $options = [])

Move/rename a branch and the corresponding reflog

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->branch->move('bugfix', '2.0');
Options
  • force (boolean) Move/rename a branch even if the new branch name already exists

$git->branch->delete(string $branch, array $options = [])

Delete a branch

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->branch->delete('2.0');

The branch must be fully merged in its upstream branch, or in HEAD if no upstream was set with --track or --set-upstream.

Options
  • force (boolean) Delete a branch irrespective of its merged status

git cat-file

$git->cat->blob(string $object)

Returns the contents of blob object

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$contents = $git->cat->blob('e69de29bb2d1d6434b8b29ae775ad8');

$git->cat->type(string $object)

Returns the object type identified by $object

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$type = $git->cat->type('e69de29bb2d1d6434b8b29ae775ad8');

$git->cat->size(string $object)

Returns the object size identified by $object

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$type = $git->cat->size('e69de29bb2d1d6434b8b29ae775ad8');

git checkout

$git->checkout(string $branch, array $options = [])

Switches branches by updating the index, working tree, and HEAD to reflect the specified branch or commit

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->checkout('develop');
Options
  • force (boolean) Proceed even if the index or the working tree differs from HEAD
  • merge (boolean) Merges local modification

$git->checkout->create(string $branch, string $startPoint = null, array $options = [])

Create a new branch and checkout

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->checkout->create('patch-1');
$git->checkout->create('patch-2', 'develop');
Options
  • force (boolean) Proceed even if the index or the working tree differs from HEAD

$git->checkout->orphan(string $branch, string $startPoint = null, array $options = [])

Create a new orphan branch, named <new_branch>, started from <start_point> and switch to it

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->checkout->orphan('gh-pages');
Options
  • force (boolean) Proceed even if the index or the working tree differs from HEAD

git clone

$git->clone(string $repository, string $path = null, array $options = [])

Clone a repository into a new directory

$git = new PhpGit\Git();
$git->clone('https://github.com/kzykhys/PhpGit.git', '/path/to/repo');
Options
  • shared (boolean) Starts out without any object of its own
  • bare (boolean) Make a bare GIT repository

git commit

$git->commit(string $message, array $options = [])

Record changes to the repository

$git = new PhpGit\Git();
$git->clone('https://github.com/kzykhys/PhpGit.git', '/path/to/repo');
$git->setRepository('/path/to/repo');
$git->add('README.md');
$git->commit('Fixes README.md');
Options
  • all (boolean) Stage files that have been modified and deleted
  • reuse-message (string) Take an existing commit object, and reuse the log message and the authorship information (including the timestamp) when creating the commit
  • squash (string) Construct a commit message for use with rebase --autosquash
  • author (string) Override the commit author
  • date (string) Override the author date used in the commit
  • cleanup (string) Can be one of verbatim, whitespace, strip, and default
  • amend (boolean) Used to amend the tip of the current branch

git config

$git->config(array $options = [])

Returns all variables set in config file

Options
  • global (boolean) Read or write configuration options for the current user
  • system (boolean) Read or write configuration options for all users on the current machine

$git->config->set(string $name, string $value, array $options = [])

Set an option

Options
  • global (boolean) Read or write configuration options for the current user
  • system (boolean) Read or write configuration options for all users on the current machine

$git->config->add(string $name, string $value, array $options = [])

Adds a new line to the option without altering any existing values

Options
  • global (boolean) Read or write configuration options for the current user
  • system (boolean) Read or write configuration options for all users on the current machine

git describe

$git->describe(string $committish = null, array $options = [])

Returns the most recent tag that is reachable from a commit

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->tag->create('v1.0.0');
$git->commit('Fixes #14');
echo $git->describe('HEAD', ['tags' => true]);
Output Example
v1.0.0-1-g7049efc
Options
  • all (boolean) Enables matching any known branch, remote-tracking branch, or lightweight tag
  • tags (boolean) Enables matching a lightweight (non-annotated) tag
  • always (boolean) Show uniquely abbreviated commit object as fallback

$git->describe->tags(string $committish = null, array $options = [])

Equivalent to $git->describe($committish, ['tags' => true]);


git fetch

$git->fetch(string $repository, string $refspec = null, array $options = [])

Fetches named heads or tags from one or more other repositories, along with the objects necessary to complete them

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'git://your/repo.git');
$git->fetch('origin');
Options
  • append (boolean) Append ref names and object names of fetched refs to the existing contents of .git/FETCH_HEAD
  • keep (boolean) Keep downloaded pack
  • prune (boolean) After fetching, remove any remote-tracking branches which no longer exist on the remote

$git->fetch->all(array $options = [])

Fetch all remotes

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'git://your/repo.git');
$git->remote->add('release', 'git://your/another_repo.git');
$git->fetch->all();
Options
  • append (boolean) Append ref names and object names of fetched refs to the existing contents of .git/FETCH_HEAD
  • keep (boolean) Keep downloaded pack
  • prune (boolean) After fetching, remove any remote-tracking branches which no longer exist on the remote

git init

$git->init(string $path, array $options = [])

Create an empty git repository or reinitialize an existing one

$git = new PhpGit\Git();
$git->init('/path/to/repo1');
$git->init('/path/to/repo2', array('shared' => true, 'bare' => true));
Options
  • shared (boolean) Specify that the git repository is to be shared amongst several users
  • bare (boolean) Create a bare repository

git log

$git->log(string $revRange = '', string $path = null, array $options = [])

Returns the commit logs

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$logs = $git->log(array('limit' => 10));
Output Example
[
    0 => [
        'hash'  => '1a821f3f8483747fd045eb1f5a31c3cc3063b02b',
        'name'  => 'John Doe',
        'email' => '[email protected]',
        'date'  => 'Fri Jan 17 16:32:49 2014 +0900',
        'title' => 'Initial Commit'
    ],
    1 => [
        //...
    ]
]
Options
  • limit (integer) Limits the number of commits to show
  • skip (integer) Skip number commits before starting to show the commit output

git merge

$git->merge(string|array|\Traversable $commit, string $message = null, array $options = [])

Incorporates changes from the named commits into the current branch

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->merge('1.0');
$git->merge('1.1', 'Merge message', ['strategy' => 'ours']);
Options
  • no-ff (boolean) Do not generate a merge commit if the merge resolved as a fast-forward, only update the branch pointer
  • rerere-autoupdate (boolean) Allow the rerere mechanism to update the index with the result of auto-conflict resolution if possible
  • squash (boolean) Allows you to create a single commit on top of the current branch whose effect is the same as merging another branch
  • strategy (string) Use the given merge strategy
  • strategy-option (string) Pass merge strategy specific option through to the merge strategy

$git->merge->abort()

Abort the merge process and try to reconstruct the pre-merge state

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
try {
    $git->merge('dev');
} catch (PhpGit\Exception\GitException $e) {
    $git->merge->abort();
}

git mv

$git->mv(string|array|\Iterator $source, string $destination, array $options = [])

Move or rename a file, a directory, or a symlink

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->mv('UPGRADE-1.0.md', 'UPGRADE-1.1.md');
Options
  • force (boolean) Force renaming or moving of a file even if the target exists

git pull

$git->pull(string $repository = null, string $refspec = null, array $options = [])

Fetch from and merge with another repository or a local branch

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->pull('origin', 'master');

git push

$git->push(string $repository = null, string $refspec = null, array $options = [])

Update remote refs along with associated objects

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->push('origin', 'master');

git rebase

$git->rebase(string $upstream = null, string $branch = null, array $options = [])

Forward-port local commits to the updated upstream head

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->fetch('origin');
$git->rebase('origin/master');
Options
  • onto (string) Starting point at which to create the new commits
  • no-verify (boolean) Bypasses the pre-rebase hook
  • force-rebase (boolean) Force the rebase even if the current branch is a descendant of the commit you are rebasing onto

$git->rebase->continues()

Restart the rebasing process after having resolved a merge conflict

$git->rebase->abort()

Abort the rebase operation and reset HEAD to the original branch

$git->rebase->skip()

Restart the rebasing process by skipping the current patch


git remote

$git->remote()

Returns an array of existing remotes

$git = new PhpGit\Git();
$git->clone('https://github.com/kzykhys/Text.git', '/path/to/repo');
$git->setRepository('/path/to/repo');
$remotes = $git->remote();
Output Example
[
    'origin' => [
        'fetch' => 'https://github.com/kzykhys/Text.git',
        'push'  => 'https://github.com/kzykhys/Text.git'
    ]
]

$git->remote->add(string $name, string $url, array $options = [])

Adds a remote named $name for the repository at $url

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->fetch('origin');
Options
  • tags (boolean) With this option, git fetch <name> imports every tag from the remote repository
  • no-tags (boolean) With this option, git fetch <name> does not import tags from the remote repository

$git->remote->rename(string $name, string $newName)

Rename the remote named $name to $newName

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->rename('origin', 'upstream');

$git->remote->rm(string $name)

Remove the remote named $name

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->rm('origin');

$git->remote->show(string $name)

Gives some information about the remote $name

$git = new PhpGit\Git();
$git->clone('https://github.com/kzykhys/Text.git', '/path/to/repo');
$git->setRepository('/path/to/repo');
echo $git->remote->show('origin');
Output Example
\* remote origin
  Fetch URL: https://github.com/kzykhys/Text.git
  Push  URL: https://github.com/kzykhys/Text.git
  HEAD branch: master
  Remote branch:
    master tracked
  Local branch configured for 'git pull':
    master merges with remote master
  Local ref configured for 'git push':
    master pushes to master (up to date)

$git->remote->prune(string $name = null)

Deletes all stale remote-tracking branches under $name

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->prune('origin');

$git->remote->head(string $name, string $branch = null)

Alias of set()

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->head('origin');

$git->remote->head->set(string $name, string $branch)

Sets the default branch for the named remote

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->head->set('origin');

$git->remote->head->delete(string $name)

Deletes the default branch for the named remote

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->head->delete('origin');

$git->remote->head->remote(string $name)

Determine the default branch by querying remote

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->head->remote('origin');

$git->remote->branches(string $name, array $branches)

Alias of set()

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->branches('origin', array('master', 'develop'));

$git->remote->branches->set(string $name, array $branches)

Changes the list of branches tracked by the named remote

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->branches->set('origin', array('master', 'develop'));

$git->remote->branches->add(string $name, array $branches)

Adds to the list of branches tracked by the named remote

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->branches->add('origin', array('master', 'develop'));

$git->remote->url(string $name, string $newUrl, string $oldUrl = null, array $options = [])

Alias of set()

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->url('origin', 'https://github.com/text/Text.git');
Options
  • push (boolean) Push URLs are manipulated instead of fetch URLs

$git->remote->url->set(string $name, string $newUrl, string $oldUrl = null, array $options = [])

Sets the URL remote to $newUrl

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->url->set('origin', 'https://github.com/text/Text.git');
Options
  • push (boolean) Push URLs are manipulated instead of fetch URLs

$git->remote->url->add(string $name, string $newUrl, array $options = [])

Adds new URL to remote

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->url->add('origin', 'https://github.com/text/Text.git');
Options
  • push (boolean) Push URLs are manipulated instead of fetch URLs

$git->remote->url->delete(string $name, string $url, array $options = [])

Deletes all URLs matching regex $url

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->remote->add('origin', 'https://github.com/kzykhys/Text.git');
$git->remote->url->delete('origin', 'https://github.com');
Options
  • push (boolean) Push URLs are manipulated instead of fetch URLs

git reset

$git->reset(string|array|\Traversable $paths, string $commit = null)

Resets the index entries for all $paths to their state at $commit

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->reset();

$git->reset->soft(string $commit = null)

Resets the current branch head to $commit

Does not touch the index file nor the working tree at all (but resets the head to $commit, just like all modes do). This leaves all your changed files "Changes to be committed", as git status would put it.

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->reset->soft();

$git->reset->mixed(string $commit = null)

Resets the current branch head to $commit

Resets the index but not the working tree (i.e., the changed files are preserved but not marked for commit) and reports what has not been updated. This is the default action.

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->reset->mixed();

$git->reset->hard(string $commit = null)

Resets the current branch head to $commit

Resets the index and working tree. Any changes to tracked files in the working tree since $commit are discarded

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->reset->hard();

$git->reset->merge(string $commit = null)

Resets the current branch head to $commit

Resets the index and updates the files in the working tree that are different between $commit and HEAD, but keeps those which are different between the index and working tree (i.e. which have changes which have not been added). If a file that is different between $commit and the index has unstaged changes, reset is aborted

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->reset->merge();

$git->reset->keep(string $commit = null)

Resets the current branch head to $commit

Resets index entries and updates files in the working tree that are different between $commit and HEAD. If a file that is different between $commit and HEAD has local changes, reset is aborted.

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->reset->keep();

$git->reset->mode(string $mode, string $commit = null)

Resets the current branch head to $commit

Possibly updates the index (resetting it to the tree of $commit) and the working tree depending on $mode

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->reset->mode('hard');

git rm

$git->rm(string|array|\Traversable $file, array $options = [])

Remove files from the working tree and from the index

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->rm('CHANGELOG-1.0-1.1.txt', ['force' => true]);
Options
  • force (boolean) Override the up-to-date check
  • cached (boolean) Unstage and remove paths only from the index
  • recursive (boolean) Allow recursive removal when a leading directory name is given

$git->rm->cached(string|array|\Traversable $file, array $options = [])

Equivalent to $git->rm($file, ['cached' => true]);

Options
  • force (boolean) Override the up-to-date check
  • recursive (boolean) Allow recursive removal when a leading directory name is given

git shortlog

$git->shortlog(string|array|\Traversable $commits = HEAD)

Summarize 'git log' output

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$shortlog = $git->shortlog();
Output Example
[
    'John Doe <[email protected]>' => [
        0 => ['commit' => '589de67', 'date' => new \DateTime('2014-02-10 12:56:15 +0300'), 'subject' => 'Update README'],
        1 => ['commit' => '589de67', 'date' => new \DateTime('2014-02-15 12:56:15 +0300'), 'subject' => 'Update README'],
    ],
    //...
]

$git->shortlog->summary(string $commits = HEAD)

Suppress commit description and provide a commit count summary only

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$shortlog = $git->shortlog->summary();
Output Example
[
    'John Doe <[email protected]>' => 153,
    //...
]

git show

$git->show(string $object, array $options = [])

Shows one or more objects (blobs, trees, tags and commits)

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
echo $git->show('3ddee587e209661c8265d5bfd0df999836f6dfa2');
Options
  • format (string) Pretty-print the contents of the commit logs in a given format, where can be one of oneline, short, medium, full, fuller, email, raw and format:
  • abbrev-commit (boolean) Instead of showing the full 40-byte hexadecimal commit object name, show only a partial prefix

git stash

$git->stash()

Save your local modifications to a new stash, and run git reset --hard to revert them

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->stash();

$git->stash->save(string $message = null, array $options = [])

Save your local modifications to a new stash, and run git reset --hard to revert them.

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->stash->save('My stash');

$git->stash->lists(array $options = [])

Returns the stashes that you currently have

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$stashes = $git->stash->lists();
Output Example
[
    0 => ['branch' => 'master', 'message' => '0e2f473 Fixes README.md'],
    1 => ['branch' => 'master', 'message' => 'ce1ddde Initial commit'],
]

$git->stash->show(string $stash = null)

Show the changes recorded in the stash as a diff between the stashed state and its original parent

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
echo $git->stash->show('stash@{0}');
Output Example
 REAMDE.md |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

$git->stash->drop(string $stash = null)

Remove a single stashed state from the stash list

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->stash->drop('stash@{0}');

$git->stash->pop(string $stash = null, array $options = [])

Remove a single stashed state from the stash list and apply it on top of the current working tree state

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->stash->pop('stash@{0}');

$git->stash->apply(string $stash = null, array $options = [])

Like pop, but do not remove the state from the stash list

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->stash->apply('stash@{0}');

$git->stash->branch(string $name, string $stash = null)

Creates and checks out a new branch named starting from the commit at which the was originally created, applies the changes recorded in to the new working tree and index

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->stash->branch('hotfix', 'stash@{0}');

$git->stash->clear()

Remove all the stashed states

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->stash->clear();

$git->stash->create()

Create a stash (which is a regular commit object) and return its object name, without storing it anywhere in the ref namespace

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$commit = $git->stash->create();
Output Example
877316ea6f95c43b7ccc2c2a362eeedfa78b597d

git status

$git->status(array $options = [])

Returns the working tree status

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$status = $git->status();
Constants
  • StatusCommand::UNMODIFIED [=' '] unmodified
  • StatusCommand::MODIFIED [='M'] modified
  • StatusCommand::ADDED [='A'] added
  • StatusCommand::DELETED [='D'] deleted
  • StatusCommand::RENAMED [='R'] renamed
  • StatusCommand::COPIED [='C'] copied
  • StatusCommand::UPDATED_BUT_UNMERGED [='U'] updated but unmerged
  • StatusCommand::UNTRACKED [='?'] untracked
  • StatusCommand::IGNORED [='!'] ignored
Output Example
[
    'branch' => 'master',
    'changes' => [
        ['file' => 'item1.txt', 'index' => 'A', 'work_tree' => 'M'],
        ['file' => 'item2.txt', 'index' => 'A', 'work_tree' => ' '],
        ['file' => 'item3.txt', 'index' => '?', 'work_tree' => '?'],
    ]
]
Options
  • ignored (boolean) Show ignored files as well

git tag

$git->tag()

Returns an array of tags

$git = new PhpGit\Git();
$git->clone('https://github.com/kzykhys/PhpGit.git', '/path/to/repo');
$git->setRepository('/path/to/repo');
$tags = $git->tag();
Output Example
['v1.0.0', 'v1.0.1', 'v1.0.2']

$git->tag->create(string $tag, string $commit = null, array $options = [])

Creates a tag object

$git = new PhpGit\Git();
$git->setRepository('/path/to/repo');
$git->tag->create('v1.0.0');
Options
  • annotate (boolean) Make an unsigned, annotated tag object
  • sign (boolean) Make a GPG-signed tag, using the default e-mail address’s key
  • force (boolean) Replace an existing tag with the given name (instead of failing)

$git->tag->delete(string|array|\Traversable $tag)

Delete existing tags with the given names

$git->tag->verify(string|array|\Traversable $tag)

Verify the gpg signature of the given tag names


git ls-tree

$git->tree(string $branch = master, string $path = '')

Returns the contents of a tree object

$git = new PhpGit\Git();
$git->clone('https://github.com/kzykhys/PhpGit.git', '/path/to/repo');
$git->setRepository('/path/to/repo');
$tree = $git->tree('master');
Output Example
[
    ['mode' => '100644', 'type' => 'blob', 'hash' => '1f100ce9855b66111d34b9807e47a73a9e7359f3', 'file' => '.gitignore', 'sort' => '2:.gitignore'],
    ['mode' => '100644', 'type' => 'blob', 'hash' => 'e0bfe494537037451b09c32636c8c2c9795c05c0', 'file' => '.travis.yml', 'sort' => '2:.travis.yml'],
    ['mode' => '040000', 'type' => 'tree', 'hash' => '8d5438e79f77cd72de80c49a413f4edde1f3e291', 'file' => 'bin', 'sort' => '1:.bin'],
]

License

The MIT License

Author

Developed by Kazuyuki Hayashi (@kzykhys), Maintained by @inhere

Comments
  • build(deps): bump toolkit/stdlib from 1.1.1 to 1.1.2

    build(deps): bump toolkit/stdlib from 1.1.1 to 1.1.2

    Bumps toolkit/stdlib from 1.1.1 to 1.1.2.

    Commits
    • 0c58476 feat: add new method for load data to DataObject
    • 02b79c5 feat: add some new string uitl methods and tests
    • f12bd5e fix: fix str util unit tests error
    • a5a3660 feat: add method Str::toNoEmptyArray instead splitTrimFiltered
    • 14da44a feat: add more str and url helper methods, add more tests
    • be542ca prof: update some str method logic, add new str method
    • 5578426 feat: add more string handle methods, class
    • e80dff7 feat: add new method for check string contains all substr
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • build(deps): bump toolkit/stdlib from 2.0.7 to 2.0.8

    build(deps): bump toolkit/stdlib from 2.0.7 to 2.0.8

    Bumps toolkit/stdlib from 2.0.7 to 2.0.8.

    Release notes

    Sourced from toolkit/stdlib's releases.

    v2.0.8

    Change Log

    Update

    • 0f26766 up: update the Php.exception2html() render logic
    • 7a3f5e7 up: update some for ObjectBox create object
    • 0b7ac57 up: update some str class method
    • eb06c3a up: update some generic class logic
    • d182614 up: add fromJson for quick create DataObject
    • 6b825e7 up: update some method for object helper
    • 397a029 up: update some array helper methods
    • c3a38a2 up: update and add some string helper methods
    • d592891 up: update some for data and stream helper

    Other

    • 09ec9a0 ci: fix unit test error
    Commits
    • 09ec9a0 ci: fix unit test error
    • d592891 up: update some for data and stream helper
    • c3a38a2 up: update and add some string helper methods
    • 397a029 up: update some array helper methods
    • 6b825e7 up: update some method for object helper
    • d182614 up: add fromJson for quick create DataObject
    • eb06c3a up: update some generic class logic
    • 0b7ac57 up: update some str class method
    • 7a3f5e7 up: update some for ObjectBox create object
    • 0f26766 up: update the Php.exception2html() render logic
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • build(deps): bump symfony/options-resolver from 6.1.0 to 6.2.0

    build(deps): bump symfony/options-resolver from 6.1.0 to 6.2.0

    Bumps symfony/options-resolver from 6.1.0 to 6.2.0.

    Release notes

    Sourced from symfony/options-resolver's releases.

    v6.2.0

    Changelog (https://github.com/symfony/options-resolver/compare/v6.2.0-RC2...v6.2.0)

    • no significant changes

    v6.2.0-RC1

    Changelog (https://github.com/symfony/options-resolver/compare/v6.2.0-BETA3...v6.2.0-RC1)

    • no significant changes

    v6.2.0-BETA3

    Changelog (https://github.com/symfony/options-resolver/compare/v6.2.0-BETA2...v6.2.0-BETA3)

    • no significant changes

    v6.2.0-BETA1

    Changelog (https://github.com/symfony/options-resolver/compare/v6.1.6...v6.2.0-BETA1)

    • feature #47730 Ban DateTime from the codebase (WebMamba)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • build(deps): bump symfony/process from 6.1.3 to 6.2.0

    build(deps): bump symfony/process from 6.1.3 to 6.2.0

    Bumps symfony/process from 6.1.3 to 6.2.0.

    Release notes

    Sourced from symfony/process's releases.

    v6.2.0

    Changelog (https://github.com/symfony/process/compare/v6.2.0-RC2...v6.2.0)

    • no significant changes

    v6.2.0-RC1

    Changelog (https://github.com/symfony/process/compare/v6.2.0-BETA3...v6.2.0-RC1)

    • no significant changes

    v6.2.0-BETA3

    Changelog (https://github.com/symfony/process/compare/v6.2.0-BETA2...v6.2.0-BETA3)

    • no significant changes

    v6.2.0-BETA1

    Changelog (https://github.com/symfony/process/compare/v6.1.6...v6.2.0-BETA1)

    • no significant changes
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • build(deps-dev): bump symfony/filesystem from 6.1.4 to 6.1.5

    build(deps-dev): bump symfony/filesystem from 6.1.4 to 6.1.5

    Bumps symfony/filesystem from 6.1.4 to 6.1.5.

    Release notes

    Sourced from symfony/filesystem's releases.

    v6.1.5

    Changelog (https://github.com/symfony/filesystem/compare/v6.1.4...v6.1.5)

    • no significant changes
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • build(deps-dev): bump symfony/filesystem from 6.1.3 to 6.1.4

    build(deps-dev): bump symfony/filesystem from 6.1.3 to 6.1.4

    Bumps symfony/filesystem from 6.1.3 to 6.1.4.

    Release notes

    Sourced from symfony/filesystem's releases.

    v6.1.4

    Changelog (https://github.com/symfony/filesystem/compare/v6.1.3...v6.1.4)

    • bug #47155 Remove needless mb_* calls (HellFirePvP)
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • build(deps): bump toolkit/stdlib from 2.0.6 to 2.0.7

    build(deps): bump toolkit/stdlib from 2.0.6 to 2.0.7

    Bumps toolkit/stdlib from 2.0.6 to 2.0.7.

    Release notes

    Sourced from toolkit/stdlib's releases.

    v2.0.7

    Change Log

    Fixed

    Feature

    Update

    Commits
    • 13fd2e5 fix: fix test error for Str::shellQuote
    • 2b897ee fix: fix unit tests error on action
    • c791e81 up: update the gh release script
    • e5fc286 feat: arr, str - add some new helper method
    • 2aa57a0 up: fix shell quote for option name
    • a7f3613 up: add new string util method Str.shellQuotesToLine()
    • aa7b587 up: add new string util method Str.shellQuotes()
    • 02b2fca fix: index key name error on read OS user
    • c41ea63 fix: fetch OS current user name error on Windows
    • e1e7798 up: add new string func for split string to words
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • build(deps-dev): bump symfony/filesystem from 6.1.0 to 6.1.3

    build(deps-dev): bump symfony/filesystem from 6.1.0 to 6.1.3

    Bumps symfony/filesystem from 6.1.0 to 6.1.3.

    Release notes

    Sourced from symfony/filesystem's releases.

    v6.1.3

    Changelog (https://github.com/symfony/filesystem/compare/v6.1.2...v6.1.3)

    • no significant changes
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • build(deps): bump symfony/process from 6.1.0 to 6.1.3

    build(deps): bump symfony/process from 6.1.0 to 6.1.3

    Bumps symfony/process from 6.1.0 to 6.1.3.

    Release notes

    Sourced from symfony/process's releases.

    v6.1.3

    Changelog (https://github.com/symfony/process/compare/v6.1.2...v6.1.3)

    • no significant changes
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
  • build(deps): bump actions/checkout from 2 to 3

    build(deps): bump actions/checkout from 2 to 3

    Bumps actions/checkout from 2 to 3.

    Release notes

    Sourced from actions/checkout's releases.

    v3.0.0

    • Updated to the node16 runtime by default
      • This requires a minimum Actions Runner version of v2.285.0 to run, which is by default available in GHES 3.4 or later.

    v2.4.2

    What's Changed

    Full Changelog: https://github.com/actions/checkout/compare/v2...v2.4.2

    v2.4.1

    • Fixed an issue where checkout failed to run in container jobs due to the new git setting safe.directory

    v2.4.0

    • Convert SSH URLs like org-<ORG_ID>@github.com: to https://github.com/ - pr

    v2.3.5

    Update dependencies

    v2.3.4

    v2.3.3

    v2.3.2

    Add Third Party License Information to Dist Files

    v2.3.1

    Fix default branch resolution for .wiki and when using SSH

    v2.3.0

    Fallback to the default branch

    v2.2.0

    Fetch all history for all tags and branches when fetch-depth=0

    v2.1.1

    Changes to support GHES (here and here)

    v2.1.0

    ... (truncated)

    Changelog

    Sourced from actions/checkout's changelog.

    Changelog

    v3.0.2

    v3.0.1

    v3.0.0

    v2.3.1

    v2.3.0

    v2.2.0

    v2.1.1

    • Changes to support GHES (here and here)

    v2.1.0

    v2.0.0

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • build(deps): bump toolkit/stdlib from 1.1.4 to 1.2.0

    build(deps): bump toolkit/stdlib from 1.1.4 to 1.2.0

    Bumps toolkit/stdlib from 1.1.4 to 1.2.0.

    Release notes

    Sourced from toolkit/stdlib's releases.

    v1.2.0

    Change Log

    breaking

    Feature

    Update

    Fixed

    Other

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • build(deps-dev): bump symfony/filesystem from 6.1.5 to 6.2.0

    build(deps-dev): bump symfony/filesystem from 6.1.5 to 6.2.0

    Bumps symfony/filesystem from 6.1.5 to 6.2.0.

    Release notes

    Sourced from symfony/filesystem's releases.

    v6.2.0

    Changelog (https://github.com/symfony/filesystem/compare/v6.2.0-RC2...v6.2.0)

    • no significant changes

    v6.2.0-RC1

    Changelog (https://github.com/symfony/filesystem/compare/v6.2.0-BETA3...v6.2.0-RC1)

    • no significant changes

    v6.2.0-BETA1

    Changelog (https://github.com/symfony/filesystem/compare/v6.1.6...v6.2.0-BETA1)

    • no significant changes
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies php 
    opened by dependabot[bot] 0
Releases(v2.0.4)
  • v2.0.4(Nov 5, 2022)

    Change Log

    • fix: remote branch line parse fail, update some command logic https://github.com/phppkg/phpgit/commit/45b1a18c8869478c96af5410889bc0d9b226708c
    Source code(tar.gz)
    Source code(zip)
  • v2.0.3(Oct 28, 2022)

    Change Log

    Fixed

    • fix: cannot use shortName, will override on have multi remote https://github.com/phppkg/phpgit/commit/f2968d4bfe4588feefd04deafce8ed9272b04f17

    Feature

    • feat: add quick method for fetch repo branch,status info https://github.com/phppkg/phpgit/commit/ae5f0527ad6c5de702c37a48b519abc781179239

    Update

    • up: update readme and remove testing on php 8.0 https://github.com/phppkg/phpgit/commit/d86c3130058eec00c1fd09d9ca56f42913df743b
    • up: update some for handle branch info https://github.com/phppkg/phpgit/commit/a1a5e2771ad132a8a6db18a80ee07b3b37ebafc6

    Other

    • chore: fix composer lock deps error and release action error https://github.com/phppkg/phpgit/commit/5827825032e3068b88cf5b6efd22e2d116acf59e
    • build(deps): bump symfony/process from 6.1.0 to 6.1.3 https://github.com/phppkg/phpgit/commit/9008b120549780c3915e41c3731df820b326d31d
    • build(deps-dev): bump symfony/filesystem from 6.1.0 to 6.1.3 https://github.com/phppkg/phpgit/commit/30181cb4f09a3f98cd3cff976e8559571b80c52d
    • Merge pull request #13 from phppkg/dependabot/composer/symfony/process-6.1.3 https://github.com/phppkg/phpgit/commit/dd0cf4de11ecea7364df6795d8656ccb5fc36a35
    • Merge pull request #14 from phppkg/dependabot/composer/symfony/filesystem-6.1.3 https://github.com/phppkg/phpgit/commit/7189d79df153ec641a56e11ac290261b88c5b82b
    • build(deps): bump toolkit/stdlib from 2.0.6 to 2.0.7 https://github.com/phppkg/phpgit/commit/3f1100b57c47904b1ab8c56b02af4a6ce0a64554
    • Merge pull request #15 from phppkg/dependabot/composer/toolkit/stdlib-2.0.7 https://github.com/phppkg/phpgit/commit/eadd57831222e4a297b728e66d953dbdb4aefc26
    • build(deps-dev): bump symfony/filesystem from 6.1.3 to 6.1.4 https://github.com/phppkg/phpgit/commit/8e022636aa1a8551f1ac19d6c7941ea4e63b6fa9
    • Merge pull request #16 from phppkg/dependabot/composer/symfony/filesystem-6.1.4 https://github.com/phppkg/phpgit/commit/a8531c8d656ed8560e50fd99a9e38ffa3e5c44c7
    • build(deps-dev): bump symfony/filesystem from 6.1.4 to 6.1.5 https://github.com/phppkg/phpgit/commit/a53274b8e626901605605d629ad1f8728f802ba8
    • Merge pull request #17 from phppkg/dependabot/composer/symfony/filesystem-6.1.5 https://github.com/phppkg/phpgit/commit/719f2fa0b3fff1622c7e8bace2dee42190374951
    Source code(tar.gz)
    Source code(zip)
  • v2.0.2(Jun 27, 2022)

    Change Log

    Feature

    • 2dd5ec9 feat: add a bin tool bin/chlog.php for gen change logs

    Update

    • 06a350d up: update the unit tests classes, add namespace
    • 50586ca up: update some for gen change log logic
    • 5f6a27e up: update some git command logic, add branch parse

    Fixed

    • a686db8 fix: fix branch info line parse error

    Other

    • 7d575dd build(deps): bump actions/checkout from 2 to 3
    • e1494c1 chore: update gh actions, add some unit tests
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Apr 14, 2022)

    Change Log

    Fixed

    • fix: fetch current branch name error https://github.com/phppkg/phpgit/commit/a9d653e055af499aa90885a5645ca9c53749a084

    Other

    • enhance: update the group name match logic https://github.com/phppkg/phpgit/commit/7668d4d7b6944e3009f228aa3ff0d75f5e82d4b7
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Dec 5, 2021)

    Change Log

    Update

    • update: migrate some syntax to php 8.0+ https://github.com/phppkg/phpgit/commit/dc64786ddc8c209f8d9af775fcb30368f5a04843

    Other

    • breaking: will only support php 8.0+ https://github.com/phppkg/phpgit/commit/117215fc36b41099b2d6799ead99ee9238201107
    Source code(tar.gz)
    Source code(zip)
  • v1.0.2(Dec 5, 2021)

    Change Log

    Update

    • up: add gen chlog on release action https://github.com/phppkg/phpgit/commit/f5573c2d7e9405b56de0206da37dec4db85ed03d

    Other

    • build(deps): bump toolkit/stdlib from 1.0.24 to 1.1.0 https://github.com/phppkg/phpgit/commit/eda91a19d768a62d72f6c0ec1236699d4e721916
    • build(deps): bump toolkit/stdlib from 1.1.0 to 1.1.1 https://github.com/phppkg/phpgit/commit/d3aa825bd6b5257889b801003432bd2c6c02c4b4
    • build(deps): bump toolkit/cli-utils from 1.2.13 to 1.2.14 https://github.com/phppkg/phpgit/commit/4fde8c3695dc074ae5a1a96417f9cc2d6d03de64
    • build(deps): bump toolkit/stdlib from 1.1.1 to 1.1.3 https://github.com/phppkg/phpgit/commit/a9fc0936e1cbf86cd8b2db673404f35e95e04718
    • build(deps): bump toolkit/stdlib from 1.1.3 to 1.1.4 https://github.com/phppkg/phpgit/commit/6870375682c20db492598e38421236e2a4e52480
    • build(deps): bump symfony/process from 4.4.30 to 4.4.34 https://github.com/phppkg/phpgit/commit/3c246da43960004fb541750e6c01340f02292fcd
    • build(deps): bump symfony/process from 4.4.34 to 4.4.35 https://github.com/phppkg/phpgit/commit/7cdd754250ee83bc4c4fb890b074584b28356d3e
    • build(deps): bump toolkit/stdlib from 1.1.4 to 1.2.0 https://github.com/phppkg/phpgit/commit/ed60781b8f06033a86e4301d83ed4125ab2ca65a
    • chore: add ci tests on php 8.1 https://github.com/phppkg/phpgit/commit/828046cb4a744e14394929f908b336a628a97049
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Oct 27, 2021)

  • v1.0.0(Sep 27, 2021)

Owner
PHPPkg
Some useful package for PHP
PHPPkg
Remote Git Library for PHP

This library provides methods to handle git repositories remotely without having to clone the whole repo. It uses the Symfony process component to run the git client.

Martin Auswöger 4 Dec 14, 2022
Very flexible git hook manager for php developers

CaptainHook CaptainHook is an easy to use and very flexible git hook library for php developers. It enables you to configure your git hook actions in

CaptainHook 812 Dec 30, 2022
Version is a library that helps with managing the version number of Git-hosted PHP projects

Version Version is a library that helps with managing the version number of Git-hosted PHP projects. Installation You can add this library as a local,

Sebastian Bergmann 6.3k Dec 26, 2022
Utility that helps you switch git configurations with ease.

git-profile Utility that helps you switch git configurations with ease Preface It is possible that you have multiple git configurations. For example:

Zeeshan Ahmad 240 Jul 18, 2022
Private, self-hosted Composer/Satis repository with unlimited private and open-source packages and support for Git, Mercurial, and Subversion.

Private, self-hosted Composer/Satis repository with unlimited private and open-source packages and support for Git, Mercurial, and Subversion. HTTP API, HTTPs support, webhook handler, scheduled builds, Slack and HipChat integration.

Łukasz Lach 112 Nov 24, 2022
RealMikrotikBackup - Система резервного копирования для оборудования Mikrotik, с возможностью использования функционала Git для контроля версий конфигураций оборудования.

Real Mikrotik Backup System Real Mikrotik Backup - это система централизованного создания и хранения резервных копий оборудования Mikrotik с функцией

Anton Moroz 23 Dec 18, 2022
Easily manage git hooks in your composer config

composer-git-hooks Manage git hooks easily in your composer configuration. This command line tool makes it easy to implement a consistent project-wide

Ezinwa Okpoechi 985 Jan 3, 2023
Text-mode interface for git

Tig: text-mode interface for Git What is Tig? Tig is an ncurses-based text-mode interface for git. It functions mainly as a Git repository browser, bu

Jonas Fonseca 11.4k Dec 30, 2022
CodeFever Community Edition (A Self-hosted Git Services)

CodeFever Community Edition (A Self-hosted Git Services)

PGYER 2.3k Jan 7, 2023
A Laravel test build by Incline Start-up Agency. Testing Git and framework functions.

Incognito-Confessions A laravel test build by Incline Start-up Agency. Testing Git and framework functions. Description A laravel starter for future t

null 6 Nov 9, 2022
Install an execute script of specify quality tools to your git pre-commit hook, and it executes only for changed files

Quality Hook Installer Install an execute script of specify quality tools to your git pre-commit hook, and it executes only for changed files Install

Kay W. 2 Dec 15, 2022
Lightweight PHP wrapper for OVH APIs. That's the easiest way to use OVH.com APIs in your PHP applications.

This PHP package is a lightweight wrapper for OVH APIs. That's the easiest way to use OVH.com APIs in your PHP applications.

OVHcloud 263 Dec 14, 2022
nmap is a PHP wrapper for Nmap.

nmap nmap is a PHP wrapper for Nmap, a free security scanner for network exploration. Usage use Nmap\Nmap; $hosts = Nmap::create()->scan([ 'williamdur

William Durand 151 Sep 24, 2022
AI PHP is a wrapper for rubix ml to make AI very approachable

AI PHP Rubix Wrap A wrapper for Rubix ML to make it very approachable Example: $report = RubixService::train($data, 'column_with_label'); Where co

null 15 Nov 5, 2022
Opensource php wrapper to WhatsApp Cloud API.

WhatsApp Latest Cloud API Wrapper for PHP Opensource php wrapper to WhatsApp Cloud API. Features supported Sending messages Sending Media (images, aud

Novath Thomas 58 Nov 30, 2022
A simple Object Oriented wrapper for Linear API, written with PHP.

PHP Linear API A simple Object Oriented wrapper for Linear API, written with PHP. NOTE You should take a look Linear GraphQL API Schema for all nodes

Mustafa KÜÇÜK 6 Sep 2, 2022
An object oriented wrapper around PHP's built-in server.

Statix Server Requirements PHP 8 minumum Installation composer require statix/server Basic Usage To get started, ensure the vendor autoload script is

Statix PHP 113 Dec 27, 2022
A PHP wrapper around Libreoffice for converting documents from one format to another.

Document Converter A PHP wrapper around Libreoffice for converting documents from one format to another. For example: Microsoft Word to PDF OpenOffice

Lukas White 0 Jul 28, 2022
PHP Wrapper for the Help Scout API

Help Scout API PHP Client This is the official Help Scout PHP client. This client contains methods for easily interacting with the Help Scout Mailbox

Help Scout 94 Dec 1, 2022