Download the PHP package ahmedessam/laravel-git-toolkit without Composer
On this page you can find all versions of the php package ahmedessam/laravel-git-toolkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ahmedessam/laravel-git-toolkit
More information about ahmedessam/laravel-git-toolkit
Files in ahmedessam/laravel-git-toolkit
Package laravel-git-toolkit
Short Description A toolkit for managing git repositories in Laravel applications.
License MIT
Informations about the package laravel-git-toolkit
Laravel Git Toolkit
Laravel Git Toolkit is a comprehensive package that integrates Git operations within your Laravel projects. It provides commands and services to help manage Git workflows more efficiently, with support for Git Flow, conventional commits, and modern Laravel architecture patterns.
Installation
You can install the package via Composer:
You can publish the configuration file with:
Environment Variables
The package uses the following environment variables:
GIT_PUSH_TO_DEFAULT_BRANCH
- Whether to push changes to the default branch. Default isfalse
.GIT_DEFAULT_BRANCH
- The default branch to push changes to. Default iscurrent
.GIT_PUSH_WITH_DEFAULT_MESSAGE
- Whether to push changes with the default commit message. Default isfalse
.GIT_DEFAULT_COMMIT_TYPE
- The default commit type. Default isfeat
.GIT_DEFAULT_COMMIT_MESSAGE
- The default commit message. Default isUpdate [%s] branch with latest changes.
.GIT_PUSH_AFTER_COMMIT
- Whether to push changes after committing. Default istrue
.GIT_RETURN_TO_PREVIOUS_BRANCH
- Whether to return to the previous branch after committing. Default istrue
.GIT_DELETE_AFTER_MERGE
- Whether to delete the merged branch after merging. Default isfalse
.GIT_FLOW_ENABLED
- Whether to enable Git flow branches. Default istrue
.
You can add these environment variables to your .env
file.
copy the following code to your .env
file:
Notes
- The package uses the
git
command to perform Git operations. - The package asks few questions to get the required data to perform the operation.
- The package provides a list of flags to specify the required data to perform the operation.
- The package uses the following flags:
--branch
flag to specify the branch name.--message
flag to specify the commit message.--type
flag to specify the commit type.--merge
flag to specify the branch to merge.--return
flag to specify whether to return to the previous branch.--commit
flag to specify the commit hash to reset to.
Usage
To initialize git flow branches, run the following command:
This command will create the following main branches:
main
develop
staging
hotfix
You can also create feature, fix, and release branches, package ask for theses branches names.
To commit changes, run the following command:
This command will add all changes, commit them, and push them to the current branch.
To create a new branch, run the following command:
This command will create a new branch based on the type you choose.
To pull changes from the remote repository, run the following command:
This command will pull changes from the remote repository to the current branch or the branch you specify.
To merge branches, run the following command:
Flags
--merge
flag to specify the branch to merge from.--branch
flag to specify the branch or branches sperated by comma or space to merge into.- ex:
php artisan git merge --merge=feature --branch=develop,main
This command will merge the specified branch into the branch you specify.
To delete a branch, run the following command:
This command will delete the specified branch.
To Push new branch to remote repository, run the following command:
To Fetch changes from the remote repository, run the following command:
This command will fetch changes from the remote repository.
To Rebase changes from the remote repository, run the following command:
This command will rebase changes from the remote repository.
To Reset changes from the remote repository, run the following command:
This command will reset changes from the remote repository.
Features
✨ Core Git Operations
- Initialize Git flow branches with customizable naming
- Commit changes with conventional commit messages
- Create branches for features, fixes, releases, hotfixes, or custom types
- Pull, push, merge, delete, fetch, rebase, and reset operations
🏗️ Modern Architecture
- Contract-based service architecture
- Event-driven operations for extensibility
- Pipeline validation system
- Comprehensive exception handling
- Dependency injection throughout
🎯 Laravel Integration
- Laravel 9-12 compatibility
- Artisan command integration
- Service provider with automatic discovery
- Configuration management
- Event system integration
Requirements
- PHP 8.2 or higher
- Laravel 9.x, 10.x, 11.x, or 12.x
- Git installed and configured
- Remote repository access (SSH recommended)
Architecture
Contracts
The package uses contract interfaces for clean dependency injection:
Events
Listen to Git operations in your application:
Services
Access core services directly:
Testing
Run the test suite:
Run tests with coverage:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details on how to contribute.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
License
The Laravel Git Toolkit is open-sourced software licensed under the MIT license.
Author
- Ahmed Essam
- GitHub Profile
- Packagist
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Issues
If you find any issues with the package or have any questions, please feel free to open an issue on the GitHub repository.
Enjoy using Laravel Git Toolkit! 🚀
All versions of laravel-git-toolkit with dependencies
illuminate/support Version ^12.0|^11.0|^10.0|^9.0
illuminate/console Version ^12.0|^11.0|^10.0|^9.0