Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Versioncontrol Git Laravel Package

pear/versioncontrol_git

PEAR’s VersionControl_Git is a PHP library for interacting with Git repositories from your code. It wraps common git commands (status, log, diff, commit, branch, tag, etc.), supports executing via the Git CLI, and helps automate repository workflows in PHP apps.

View on GitHub
Deep Wiki
Context7

Getting Started

This package is archived and no longer actively maintained — proceed with caution in production. For historical or legacy integration purposes, start by installing via Composer (if still available via Packagist or direct repository access). The core class is VersionControl_Git, which requires a path to a Git repository and optionally credentials. Begin by instantiating it with new VersionControl_Git('/path/to/repo'), then explore methods like log(), status(), branch(), or commit() for basic operations. Check docs/ or examples/ in the repository for early usage patterns — but be aware that examples may be outdated.

Implementation Patterns

  • Wrapper Layer: Due to deprecation, wrap its usage in your own service class (e.g., GitService) to abstract method calls and mitigate future breakage.
  • Stateless Operations: The library does not maintain repository state; each method invocation typically spawns a Git CLI call. This makes it suitable for fire-and-forget tasks like deploy hooks or one-off diagnostics.
  • Command Chaining: Leverage runCommand() for lower-level control when built-in methods (e.g., fetch(), push(), revParse()) lack required options.
  • Error Handling: Use getErrors() after operations — many methods return false on failure and populate internal error log instead of throwing exceptions.

Gotchas and Tips

  • ⚠️ No Auth Support: Does not handle SSH agent, tokens, or credentials. You must configure your environment (e.g., SSH keys, .netrc, or local repository with cached credentials).
  • CLI Dependency: Relies on the system git binary — ensure it's installed and in $PATH. No fallback for environments without Git CLI.
  • PHP 8+ Compatibility: Being archived and old (last commit ~2014), it may fail under modern PHP versions due to deprecated features (e.g., __toString() in objects, strict types, each() usage). Audit code and apply fixes if necessary.
  • Limited Testing: No PHPUnit tests in the repo — manual verification of functionality is essential before deployment.
  • Alternative: Consider using symfony/process + direct CLI calls or modern libraries like gitonomy/gitlib (active, PSR-compatible) instead for new projects.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport