Skip to content

Git hooks tailored specifically for Laravel development

Notifications You must be signed in to change notification settings

cesarLDsousa/git-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Welcome to My Awesome Git-Hooks Project! 🎉

Description

Welcome to my collection of Git hooks tailored specifically for Laravel development! Git hooks are powerful tools that allow you to automate tasks and enforce coding standards throughout your development workflow. In this repository, you'll find a set of carefully crafted hooks designed to streamline your Laravel projects and enhance collaboration among your team members.

Features

  • Pre-Commit Hook: Ensure code quality and prevent committing code that doesn't meet predefined standards. This hook can run linting tools like PHP_CodeSniffer to check for coding standards violations.
  • Pre-Push Hook: Run tests before pushing your changes to the repository. This ensures that only passing code gets pushed, maintaining the integrity of your codebase.
  • Post-Merge Hook: Automatically trigger actions after a successful merge, such as clearing caches or running database migrations, to keep your development environment in sync.

Getting Started

To start using these Git hooks in your Laravel projects, follow these simple steps:

  1. Clone this repository to your local machine.
  2. Navigate to your Laravel project's directory.
  3. Copy the desired hook scripts from this repository into the .git/hooks directory of your Laravel project.
  4. Make the hook scripts executable by running chmod +x .git/hooks/<hook-name>.
  5. Customize the hook scripts to fit your project's specific requirements, such as adjusting coding standards rules or specifying which tests to run.

Usage

Once you've set up the Git hooks in your Laravel project, they will automatically execute at the specified points in your Git workflow. Here are some common use cases for each hook:

  • Pre-Commit Hook: Use this hook to enforce coding standards and prevent committing code with syntax errors or style violations.
  • Pre-Push Hook: Run your test suite before pushing changes to ensure that only passing code is pushed to the remote repository.
  • Post-Merge Hook: Perform any necessary post-merge actions, such as clearing caches or reloading configuration, to keep your development environment consistent.

Contributing

If you have any ideas for additional Git hooks or improvements to existing ones, feel free to open an issue or submit a pull request. Contributions are welcome and greatly appreciated!

About

Git hooks tailored specifically for Laravel development

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages