Download the PHP package aaronidikko/laravel-git-sync without Composer

On this page you can find all versions of the php package aaronidikko/laravel-git-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-git-sync

Laravel Git Sync

A Laravel package that enables developers to commit and push code changes to Git with a single command.

Latest Version on Packagist Total Downloads

Quick Start

Global Installation (Recommended for Personal Use):

Note: If you get "command not found: git-sync", see the PATH setup instructions below.

Per-Project Installation (Recommended for Teams):

Optional: Run php artisan git:sync:install to enable the shorter composer sync command. Details below.

Features

Installation

You can install this package in two ways:

Option 1: Per-Project Installation (Recommended for Teams)

Install in a specific Laravel project:

Benefits:

Optional: Enable composer sync (One-Time Setup)

The php artisan git:sync command is automatically available after installation. The install command below is optional and only adds a convenient composer sync shortcut.

Run this command once to add a composer sync shortcut to your project:

What it does:

After running install, you can use:

Available Commands:

Option 2: Global Installation (Recommended for Personal Use)

Install once, use everywhere:

Important: Add Composer's bin directory to your PATH

After installation, you need to add Composer's global bin directory to your PATH to use the git-sync command:

Step 1: Find your Composer bin directory

This is usually ~/.composer/vendor/bin or ~/.config/composer/vendor/bin

Step 2: Add to PATH based on your shell

For Bash (add to ~/.bashrc or ~/.bash_profile):

For Zsh (add to ~/.zshrc):

For Fish (add to ~/.config/fish/config.fish):

Step 3: Verify installation

Benefits:

Usage:

Publishing Configuration (Per-Project Only)

If you installed per-project and want to customize settings:

This creates config/git-sync.php where you can customize commit message format, prefixes, etc.

Installation Comparison

Feature Global Installation Per-Project Installation
Command git-sync php artisan git:sync or vendor/bin/git-sync
Install Once ✅ Yes, use everywhere ❌ No, per project
Team Sharing ❌ Manual install for each ✅ Auto via composer.json
Config File ❌ Not available ✅ Customizable
Works in Non-Laravel ✅ Yes, basic git sync ❌ No
Command Length ✅ Shortest (git-sync) ⚠️ Longer
Best For Personal projects, quick use Team projects, consistency

Usage

The package provides different commands based on installation type:

1. Global Command (If Installed Globally)

Simplest and fastest option:

2. Artisan Command (Per-Project Installation)

Standard Laravel command:

3. Direct Binary (Per-Project Installation)

Alternative for per-project installations:

Optional: Add Composer Script Shortcut

Note: The php artisan git:sync command works immediately after installation. This section is optional and only adds a shorter composer sync alias.

To enable composer sync in your project, run this one-time setup command:

This automatically adds "sync": "@php artisan git:sync" to your project's composer.json, creating a shortcut.

Then use:

How It Works

All commands will:

  1. Stage all changes (git add .)
  2. Commit with message like chore: 2025-10-25 09:30 (or your custom message)
  3. Push to the current branch

Which Command Should I Use?

Installation Type Recommended Command Why?
Global git-sync Shortest, fastest
Per-Project php artisan git:sync Standard Laravel convention
Per-Project (Alt) vendor/bin/git-sync Direct binary access
Per-Project (Optional) composer sync Requires running git:sync:install first

Understanding the Commands

Q: What's the difference between php artisan git:sync and composer sync?

A: They do the exact same thing! composer sync is just a shortcut that internally calls php artisan git:sync.

Q: Do I need to run git:sync:install?

A: No, it's completely optional! Use it only if you prefer typing composer sync instead of php artisan git:sync.

Q: What does git:sync:install do?

A: It adds this line to your project's composer.json:

This creates a Composer script alias, nothing more.

Command Options Reference

All commands support the same options:

Option Shorthand Description
--message="text" -m "text" Custom commit message
--commit-only - Commit without pushing
--push-only - Push without committing
--pull - Pull changes from remote before pushing
--dry-run - Preview actions without executing
--verbose - Show detailed output
--branch=name - Push to specific branch

Examples with git-sync (Global):

Examples with artisan (Per-Project):

Examples with vendor/bin (Per-Project):

Configuration

After publishing the config file, you can customize settings in config/git-sync.php:

Environment Variables

You can also configure via .env:

Examples

Daily Development Workflow

With Global Installation:

With Per-Project Installation:

Working with Feature Branches

Global:

Per-Project:

Using in Non-Laravel Projects

If you have the package installed globally, it works even in non-Laravel git repositories with basic git sync functionality:

Note: Configuration options (custom prefixes, timestamp format, etc.) only work in Laravel projects with the config file published.

Handling Remote Changes

When the remote repository has commits that you don't have locally, you need to pull those changes before pushing. The --pull option handles this automatically:

Global:

Per-Project:

The pull respects your git configuration. If you have pull.rebase=true set, it will rebase your commits. Otherwise, it will merge.

Note: If there are merge conflicts during the pull, the command will stop and prompt you to resolve them manually.

Error Handling

The package handles common Git scenarios:

Troubleshooting

"command not found: git-sync" (Global Installation)

If you get this error after global installation, Composer's bin directory is not in your PATH.

Solution:

  1. Find your Composer bin directory:

  2. Add it to your PATH (choose based on your shell):

    For Bash:

    For Zsh:

  3. Verify it works:

"Command sync is not defined" (Per-Project Installation)

The composer sync command doesn't work automatically after installing the package. It requires a one-time setup.

Solution:

Run the install command to enable composer sync:

This automatically adds the sync script to your composer.json.

Alternative: Use these commands without setup:

Requirements

Testing

Run the test suite:

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This package is open-sourced software licensed under the MIT license.

Credits

Created by Aaron Idikko

Support

If you find this package helpful, please consider:

Changelog

Version 1.2.0

Version 1.0.0


All versions of laravel-git-sync with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aaronidikko/laravel-git-sync contains the following files

Loading the files please wait ...