atelierspierrot / git-api
A PHP API to get infos and manage a GIT distant or local repository
Installs: 218
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Language:HTML
Requires
- php: >=5.3.0
- atelierspierrot/library: 1.*
- atelierspierrot/patterns: 1.*
Requires (Dev)
- sami/sami: dev-master
This package is not auto-updated.
Last update: 2024-03-02 10:22:50 UTC
README
A PHP API to get infos and manage a GIT distant or local repository.
Usage
Working with a local repository clone:
// open a repo $local_repo = ~/repositories/git-api $repo = \GitApi\GitApi::open($local_repo) // commiters list $repo->getCommitersList() // branches list $repo->getBranchesList() // commits list $repo->getCommitsList() // current branch $repo->getCurrentBranch() // description $repo->getDescription() // tags list $repo->getTagsList() // last commit infos $repo->getLastCommitInfos() // tree $repo->getTree() // tree for first dir $repo->getTree('HEAD', $first_dir) // files info $repo->getFilesInfo() // recursive tree $repo->getRecursiveTree() // commits history $repo->getCommitsHistory()
Working with a distant repository URL will create a local clone:
// create a clone of a distant repo in a local dir // if the local clone already exists, a `git pull` will be processed on it $distant_repo = https://github.com/atelierspierrot/git-api $local_repo = ~/repositories/git-api $repo = \GitApi\GitApi::create($local_repo, $distant_repo) // ... same as above
Installation
For a complete information about how to install this package and load its namespace, please have a look at our USAGE documentation.
If you are a Composer user, just add the package to the
requirements of your project's composer.json
manifest file:
"atelierspierrot/git-api": "@stable"
You can use a specific release or the latest release of a major version using the appropriate version constraint.
Please note that this package depends on the externals PHP Patterns and PHP Library.
Author & License
GIT API
Copyright (c) 2013-2016 Pierre Cassat and contributors
Licensed under the Apache 2.0 license.
Les Ateliers Pierrot - Paris, France
http://www.ateliers-pierrot.fr/ - contact@ateliers-pierrot.fr