Updating paths is incompatible with switching branchesforcing Xn x x

Otherwise it is easy to forget what Git repositories are there within the main Moodle repository.As it was said in the previous section, this is for advanced users only.As an example we use the Certificate module from the previous section.

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 Git for developers guide.

To initialize your local checkout, use $ cd /path/to/your/webroot $ git clone git://git.moodle.org/(1) $ cd moodle $ git branch -a (2) $ git branch --track MOODLE_34_STABLE origin/MOODLE_34_STABLE (3) $ git checkout MOODLE_34_STABLE (4) Note that Git has a huge number of options for each command and it's actually possible to do the above process with a single command (left as an exercise!! Git uses a read-only protocol that may be blocked by your firewall (port 9418).

If this is a problem, you can use Github's http version https://github.com/moodle/

The command (3) creates a new local branch that will track the remote branch with a Certificate version for Moodle 3.4.

The command (4) deletes the master that was created automatically by git-clone in (2) as we do not want it in this production checkout.Therefore, create a new branch, which tracks the appropriate remote branch.Of course, this is only possible, if the remote repository offers those branches.Note: you should check first the compatibility of a module with your Moodle branch by asking directly to the Maintainer before cloning the repo or - if you want to guess it - by issuing the command below before running the command (3), in order to verify what is available among the branches: origin/master remotes/origin/MOODLE_20_STABLE remotes/origin/MOODLE_21_STABLE remotes/origin/MOODLE_22_STABLE remotes/origin/MOODLE_23_STABLE remotes/origin/MOODLE_24_STABLE remotes/origin/MOODLE_25_STABLE remotes/origin/MOODLE_26_STABLE remotes/origin/MOODLE_27_STABLE remotes/origin/MOODLE_28_STABLE remotes/origin/MOODLE_29_STABLE remotes/origin/MOODLE_30_STABLE remotes/origin/MOODLE_31_STABLE remotes/origin/master ยง git checkout -b MOODLE_31_STABLE origin/MOODLE_31_STABLE fatal: git checkout: updating paths is incompatible with switching branches.Did you intend to checkout 'origin/MOODLE_31_STABLE' which can not be resolved as commit?Now it is wise to add the new directory mod/certificate/ to the list of ignored files of the main Moodle clone, otherwise a status of the main clone will keep reminding you that the new code has not been checked in.