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

Git for Administrators: Difference between revisions

From MoodleDocs
No edit summary
Line 9: Line 9:
You can find the official Moodle git repository on git://git.moodle.org/moodle.git and git://github.com/moodle/moodle.git
You can find the official Moodle git repository on git://git.moodle.org/moodle.git and git://github.com/moodle/moodle.git


==Downloading the files==
==Initial download of the Moodle code==


<code>git clone git://github.com/moodle/moodle.git</code>
<code>git clone git://github.com/moodle/moodle.git</code>


==Moving to the correct version of Moodle==
==Moving to the correct version of Moodle==
(only if you need something else then master)


list all existing branches
* List all existing branches


<code>git branch -a </code>
<code>git branch -a </code>


Move to the desired branch (HEAD for Moodle 2.x)
* Move to the desired branch


<code>git checkout HEAD</code>
<code>git checkout BRANCHE_NAME</code>


Now your codebase is on the correct latest version
Now your code base is on the correct version


==Updating your installation==
==Updating your installation==


Moodle.com performs testing and integration of fixed bugs every tuesday, so on wednesday you can install all patches by updating your code.
Moodle.com performs testing and integration of fixed bugs every Tuesday, so on Wednesday you can install all patches by updating your code.


<code>git pull</code>
<code>git pull</code>
==Important note==
At the moment, master is Moodle 2.x stable. It is wise to do a <code>git branch -a</code> before a <code>git pull</code> to see 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.


[[Category:Git]]
[[Category:Git]]


[[Category:Administrator]]
[[Category:Administrator]]

Revision as of 15:37, 14 February 2011


An alternative way for maintaining your Moodle server via CVS_for_Administrators is using Git.

Purpose of this article

The purpose of this articla is to describe how to maintain a copy of Moodle on your production server, that is easy to upgrade using Git. If you have customisations of Moodle core code, you are advised to follow the instructions on Development:Quick_Git_start_guide_for_Moodle_development

Where are the files

You can find the official Moodle git repository on git://git.moodle.org/moodle.git and git://github.com/moodle/moodle.git

Initial download of the Moodle code

git clone git://github.com/moodle/moodle.git

Moving to the correct version of Moodle

(only if you need something else then master)

  • List all existing branches

git branch -a

  • Move to the desired branch

git checkout BRANCHE_NAME

Now your code base is on the correct version

Updating your installation

Moodle.com performs testing and integration of fixed bugs every Tuesday, so on Wednesday you can install all patches by updating your code.

git pull

Important note

At the moment, master is Moodle 2.x stable. It is wise to do a git branch -a before a git pull to see 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.