@@ -5,37 +5,16 @@ Gitlib for Gitonomy
55[ ![ StyleCI] ( https://github.styleci.io/repos/5709354/shield?branch=master )] ( https://github.styleci.io/repos/5709354 )
66[ ![ License] ( https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square )] ( https://opensource.org/licenses/MIT )
77
8- This library provides methods to access Git repository from PHP.
8+ This library provides methods to access Git repository from PHP 5.6 or 7 .
99
1010It makes shell calls, which makes it less performant than any solution.
1111
1212Anyway, it's convenient and don't need to build anything to use it. That's how we love it.
1313
14- ## Documentation
15-
16- * [ Overview] ( doc/index.md )
17- * [ Debug] ( doc/debug.md )
18- * [ Development] ( doc/development.md )
19- * [ Installation] ( doc/installation.md )
20- * API
21- + [ Admin] ( doc/api/admin.md )
22- + [ Blame] ( doc/api/blame.md )
23- + [ Blob] ( doc/api/blob.md )
24- + [ Branch] ( doc/api/branch.md )
25- + [ Commit] ( doc/api/commit.md )
26- + [ Diff] ( doc/api/diff.md )
27- + [ Hooks] ( doc/api/hooks.md )
28- + [ Log] ( doc/api/log.md )
29- + [ References] ( doc/api/references.md )
30- + [ Repository] ( doc/api/repository.md )
31- + [ Revision] ( doc/api/revision.md )
32- + [ Tree] ( doc/api/tree.md )
33- + [ Working Copy] ( doc/api/workingcopy.md )
34-
35- ## Quick Start
36-
37- You can install gitlib using [ Composer] ( https://getcomposer.org/ ) . Simply
38- require the version you need:
14+ Quick Start
15+ -----------
16+
17+ You can install gitlib using [ Composer] ( https://getcomposer.org/ ) . Simply require the version you need:
3918
4019``` bash
4120$ composer require gitonomy/gitlib
@@ -51,7 +30,42 @@ or edit your `composer.json` file by hand:
5130}
5231```
5332
54- ## For Enterprise
33+ Example Usage
34+ -------------
35+
36+ ``` php
37+ <?php
38+
39+ use Gitonomy\Git\Repository;
40+
41+ $repository = new Repository('/path/to/repository');
42+
43+ foreach ($repository->getReferences()->getBranches() as $branch) {
44+ echo "- ".$branch->getName().PHP_EOL;
45+ }
46+
47+ $repository->run('fetch', ['--all']);
48+ ```
49+
50+ API Documentation
51+ -----------------
52+
53+ + [ Admin] ( doc/admin.md )
54+ + [ Blame] ( doc/blame.md )
55+ + [ Blob] ( doc/blob.md )
56+ + [ Branch] ( doc/branch.md )
57+ + [ Commit] ( doc/commit.md )
58+ + [ Diff] ( doc/diff.md )
59+ + [ Hooks] ( doc/hooks.md )
60+ + [ Log] ( doc/log.md )
61+ + [ References] ( doc/references.md )
62+ + [ Repository] ( doc/repository.md )
63+ + [ Revision] ( doc/revision.md )
64+ + [ Tree] ( doc/tree.md )
65+ + [ Working Copy] ( doc/workingcopy.md )
66+
67+ For Enterprise
68+ --------------
5569
5670Available as part of the Tidelift Subscription
5771
0 commit comments