Run composer install after git merge
Put this to .git/hooks/post-merge
:
#!/bin/bash
git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD | grep composer.lock > /dev/null
if [ $? -eq 0 ]
then
composer install
fi
This script will check if composer.lock
was modified, if yes composer install
will by executed.
Also this snippet can be used as a post-checkout
hook.
Notice that composer
command must be available in your OS.
Written by Radosław Mejer
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#