Category Archives: git

Maintain and upgrade Moodle with Git on CentOs

Git is a software development versioning control system. Using Git with Moodle will allow you to easily upgrade and maintain your Moodle site. First you will need to install Git by running the command:


sudo yum install git


Once Git is installed move into your web server document root. To move to the standard web server document root in CentOs enter the following command:


cd /var/www/html


Next we will clone a local version of Moodle by entering the following command:


git clone git://


Once this command is finished, move into the moodle directory it creates by entering the command:


cd moodle


You can list Moodle branches available by entering the following command:


git branch -a


You can then select the branch which you want to track, here we will track Moodle 3.0:


git branch –track MOODLE_30_STABLE origin/MOODLE_30_STABLE


We can now checkout this Moodle branch:


git checkout MOODLE_30_STABLE


You are now using Git to maintain your Moodle site. If you need to update your moodle site you can navigate into your Moodle directory by typing:


cd /var/www/html/moodle


Once here you just need to run the command:


git pull


That’s all there is to downloading and updating Moodle using Git!