Grunt: Getting Started with Git Hooks | Viget
Scenario: you work on a fairly large project with other developers. Getting the rest of the team to run tests before the build has been problematic. If only you could ensure that tests ran before code could even be committed...
Solution: Git Hooks to the rescue! Run anything you want before commits with the pre-commit hook. Like JSHint? Love unit testing? Run them before commits! The different hooks and potential uses are well documented, so let's take a look at their implentation and how we can improve it with Grunt.
The typical Git Hook implementation involves finding a hook (samples included in all repos) in .git/hooks, writing a shell script to do what you want, and then making it executable like chmod +x .git/hooks/pre-commit. This may not be appropriate for certain teams and could be difficult to distribute. Surely other people have already made this easier?
Enter grunt-githooks by Romaric Pascal. Getting up and running is simple. And most importantly, requirements easily transfer to collaborators.
Read full article from Grunt: Getting Started with Git Hooks | Viget
No comments:
Post a Comment