Drupal development site code updates using GIT-Pull
We started using GIT SCM for all the new development projects.
GIT's advantages are widely discussed elsewhere- it is fast, efficient, and is a DVCS.
The reason that is important is that it's much faster than SVN and the branching is so easy you don't think about it much as you develop (much less SVN merge drama :) )
One of my motivations (as the CPO in Linnovate - Chief Paranoid Officer) is not to open ssh for too much people in my production servers (not even to our developers!).
That was the motivation behind git-pull it provides a useful mechanism which lets developers easily update the code of a development site.
(right now this module can actually be used for both SVN and GIT code updates)
Setting up this module requires some Operating System configurations, the reason is file system permissions guidelines of a Drupal site (the user which runs the web server should not have access to change or create any PHP files).
This setup is based on Linux..
- Protecting .git folder from 'prying eyes':
The default .htaccess file of Drupal 6 doesn't include a protection for the .git folder.
to protect it - simply add a rewrite rule after the RewriteEngine directive:<br> RewriteEngine on<br> RewriteRule "(^|/)." - [F]<br>
the above directives will protect every name with "." in the beginning.
Drupal 7 already includes this protection. - configuring /etc/sudoers:
allow the web server's user to run git pull command - (usually apache or www-data on Linux):<br>www-data ALL=NOPASSWD: /usr/bin/git pull<br>
- edit git_pull.module file (TODO - move it to settings.php).
change in lines 'aegir' to the user which have write access to the PHP code files and document root.
line:
<?php
...
$command = 'cd '. $root .'; sudo -H -u aegir git pull 2>&1';
...
?> - enable module - and You will have new button in Drupal admin's menu - 'GIT PULL'.
Another module for managing a Drupal development site using GIT is gittyup.