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

Git Laravel Package

directorytree/git

Lightweight PHP wrapper for running Git commands on a server. Supports pull, fetch, reset (hard/soft), and remote management (get/get all/add/set URL). Requires PHP 7.3+ and a working directory set to your repo via chdir().

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Development: Enables seamless integration of Git operations (e.g., pull, fetch, reset, tag management) directly into PHP applications, reducing reliance on shell scripts or CLI tools. Ideal for:
    • CI/CD pipelines (e.g., auto-pulling updates in a staging environment).
    • Version control workflows (e.g., auto-tagging releases, managing branches).
    • Self-healing deployments (e.g., reverting to a known commit on failure).
  • Roadmap Prioritization:
    • Build vs. Buy: Avoids reinventing Git command wrappers; leverages a lightweight, maintained package instead of custom scripts.
    • Scalability: Supports PHP 7.3–8.x, ensuring compatibility with legacy and modern stacks.
  • Use Cases:
    • Internal Tools: Automate Git tasks in admin panels (e.g., "Rollback to v1.2.0").
    • Developer Experience: Embed Git operations in Laravel Artisan commands or API endpoints (e.g., /deploy/pull).
    • Testing: Mock Git commands in unit tests (via TitasGailius/terminal integration).

When to Consider This Package

  • Adopt if:
    • Your PHP app needs programmatic Git control (e.g., Laravel, Symfony, or custom scripts).
    • You’re avoiding shell_exec() for security/simplicity (this package abstracts Git calls safely).
    • Your team uses Git remotes/tags/commits and needs to interact with them via PHP.
    • You want testable Git operations (supports mocking commands).
  • Look elsewhere if:
    • You need advanced Git features (e.g., submodules, hooks, or complex merges)—consider league/git-php or CLI tools.
    • Your environment restricts Git access (e.g., shared hosting without Git installed).
    • You’re using non-PHP languages (e.g., Node.js/Python)—use native Git libraries instead.
    • You require real-time Git events (e.g., webhooks)—this package is for commands, not event listening.

How to Pitch It (Stakeholders)

For Executives: "This package lets us automate Git tasks (like pulls, resets, or tag management) directly from our PHP apps—no more manual CLI work or fragile shell scripts. It’s lightweight, secure, and integrates with our existing Laravel stack. For example, we could auto-pull updates in staging or roll back deployments programmatically, reducing downtime and developer toil. MIT-licensed and actively maintained, it’s a low-risk way to add Git automation to our toolchain."

For Engineering: *"This is a clean, dependency-injected wrapper for Git commands using titasgailius/terminal, which means:

  • No shell_exec(): Safer than raw system calls.
  • Testable: Mock Git responses in PHPUnit (great for CI/CD tests).
  • Simple API: Methods like $git->pull('main') or $git->getTags() replace verbose shell logic.
  • PHP 8 ready: Works with our current stack. Use case: Replace our custom deploy.sh script with a Laravel Artisan command using this package. Tradeoff: Limited to basic Git ops (no submodules), but covers 80% of our needs."*
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
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
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation