{"id":37013462,"url":"https://github.com/antalaron/git-version","last_synced_at":"2026-01-14T01:19:16.884Z","repository":{"id":45926126,"uuid":"110723264","full_name":"antalaron/git-version","owner":"antalaron","description":"PHP library to get current Git version","archived":false,"fork":false,"pushed_at":"2024-06-04T17:14:16.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-08T15:03:21.589Z","etag":null,"topics":["git","php","php-library"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antalaron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-14T17:35:49.000Z","updated_at":"2024-06-04T17:14:20.000Z","dependencies_parsed_at":"2024-06-04T15:09:14.248Z","dependency_job_id":"658f7626-9850-4f42-8f97-40667e73cb4c","html_url":"https://github.com/antalaron/git-version","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"ce71d788bea9ce6813919bcb55ffeb92382cec32"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/antalaron/git-version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antalaron%2Fgit-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antalaron%2Fgit-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antalaron%2Fgit-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antalaron%2Fgit-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antalaron","download_url":"https://codeload.github.com/antalaron/git-version/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antalaron%2Fgit-version/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","php","php-library"],"created_at":"2026-01-14T01:19:16.177Z","updated_at":"2026-01-14T01:19:16.871Z","avatar_url":"https://github.com/antalaron.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"GitVersion\n==========\n\n![Tests](https://github.com/antalaron/git-version/actions/workflows/push.yaml/badge.svg?branch=master)\n\nPHP library to get the Git version of the project.\n\nThis library does not depend on the Git.\n\nInstallation\n------------\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this library:\n\n```bash\n$ composer require antalaron/git-version\n```\n\nThis command requires you to have Composer installed globally, as explained\nin the [installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\nUsage\n-----\n\nTo get the version:\n\n```php\n$gitVersion = new \\Antalaron\\GitVersion\\GitVersion();\n$gitVersion-\u003egetVersion(__DIR__);\n\n// or static\n\\Antalaron\\GitVersion\\GitVersion::getGitVersion(__DIR__);\n```\n\nIf no git found, then the return value is `null`.\n\nThere is a second `$hashLenght` parameter in the methods. With that, you will get\nthe first n character of the hash.\n\nTo get the latest commit message:\n\n```php\n$gitVersion = new \\Antalaron\\GitVersion\\GitVersion();\n$gitVersion-\u003egetLatestCommit(__DIR__);\n\n// or static\n\\Antalaron\\GitVersion\\GitVersion::getGitLatestCommit(__DIR__);\n```\n\nOn error, the return value is `null`.\n\nTo get the latest commit object:\n\n```php\n$gitVersion = new \\Antalaron\\GitVersion\\GitVersion();\n$gitVersion-\u003egetLatestCommitDetails(__DIR__);\n\n// or static\n\\Antalaron\\GitVersion\\GitVersion::getGitLatestCommitDetails(__DIR__);\n```\n\nLicense\n-------\n\nThis project is under [MIT License](http://opensource.org/licenses/mit-license.php).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantalaron%2Fgit-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantalaron%2Fgit-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantalaron%2Fgit-version/lists"}