Upgrading between Moodle Stable Versions with Git
Due to the large diveregences between moodle stable versions in the Moodle git repository (e.g.
MOODLE_39_STABLE) it can be a challenge to upgrade between major Moodle versions. Here's one approach you can use if you have minimal customisations (e.g. just additonal plugins):
First, add the moodle code tree as an upstream e.g. called Moodle
git remote add moodle git://git.moodle.org/moodle.git
Checkout a new branch e.g. lets say we are going from Moodle 3.8 to Moodle 3.9, we'll call this branch
upgrade39 and base it from say
master where we have the current Moodle 3.8 code base.
git checkout -b upgrade39
Fetch the latest Moodle 3.8 and performa a minor version upgrade to the very latest Moodle 3.8 code. If you hit any conflicts here, they need to be resolved before moving on (e.g. core code customisations).
git fetch moodle MOODLE_38_STABLE
git pull moodle MOODLE_38_STABLE
Next, fetch the last Moodle 3.9 code from the upstream Moodle code repository:
git fetch moodle MOODLE_39_STABLE
Now we can attempt the rebase, rebasing our Moodle 3.8 code with the latest Moodle 3.9 stable code on the upgrade 3.9 branch:
git rebase --onto moodle/MOODLE_39_STABLE moodle/MOODLE_38_STABLE upgrade39
Hopefully the rebase works with any issues. Of course if there are problems you'll need to work through the rebase conflicts accordingly.