Difference between revisions of "Git for Administrators"

Jump to: navigation, search

Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Git for Administrators.

(See also)
m (Important note)
Line 21: Line 21:
 
== Important note ==
 
== Important note ==
  
At the moment, the master branch represents Moodle 2.0.x stable code. It is wise to do a <code>git branch -a</code> before a <code>git pull</code> to check whether Moodle 2.0 isn't branched. If Moodle 2.0 gets branched and you are still on master, you will be updating to the latest development version, which is not desirable on a production server. This is an exception caused by the transition from CVS to Git and should never happen again.
+
For pretty long time, the Moodle 2.0.x stable code lived on ''master'' branch instead of ''MOODLE_20_STABLE''. Moodle 2.0 was then branched but if you stayed on master, you would update to the latest development version, which is not desirable on a production server. This was an exception caused by the transition from CVS to Git and should never happen again.
  
 
== Using a GUI ==
 
== Using a GUI ==

Revision as of 21:47, 29 March 2011

An alternative way to maintaining your Moodle server via CVS is using Git. This page describes how to maintain a copy of Moodle on your production server which can easily be upgraded using Git. If you have customisations of Moodle core code, you are advised to follow the instructions in the Quick Git start guide for Moodle development.

Obtaining the code from Git

You can find the official Moodle git repository at git://git.moodle.org/moodle.git and git://github.com/moodle/moodle.git. To initialize your local checkout, use

   git clone git://github.com/moodle/moodle.git                    (1)
   cd moodle
   git branch -a                                                   (2)
   git checkout -b MOODLE_19_STABLE origin/MOODLE_19_STABLE        (3)

The command (1) initializes the new local repository as a clone of the upstream moodle.git repository. The command (2) lists all available branches. Use the command (3) to switch to a different branch than the default 'master'.

Updating your installation

The Moodle development team performs integration and testing of fixed bugs every Monday and Tuesday. On Wednesday you can install all patches by updating your code. Check the shortlog to see if the official repository has been already updated or not.

   cd /path/to/your/moodle/checkout
   git pull

Important note

For pretty long time, the Moodle 2.0.x stable code lived on master branch instead of MOODLE_20_STABLE. Moodle 2.0 was then branched but if you stayed on master, you would update to the latest development version, which is not desirable on a production server. This was an exception caused by the transition from CVS to Git and should never happen again.

Using a GUI

[TODO]

See also