Upgrading through git.

Upgrading through git.

by Kieran Briggs -
Number of replies: 2

Hi all.  I keep my moodle and plugins together using a git repo.  I've forked git into my own account and then created a branch from MOODLE_311_STABLE called OurMoodle.  I've then added various plugins from git using Submodules.  that way I now have our moodle as a git branch and can install it wherever I want.  The problem I have now is i'm wanting to upgrade to MOODLE_400_STABLE but if I move to that branch, then all my submodule plugins and any work I"ve done will disappear.  Is there a way to pull all changes from the MOODLE_400_STABLE Branch into my OurMoodle branch while keeping any submodules I already have?


Thanks


Kieran

Average of ratings: Useful (2)
In reply to Kieran Briggs

Re: Upgrading through git.

by Geoffrey Van Wyk -
Picture of Plugin developers
You could merge MOODLE_400_STABLE into your branch.
In reply to Geoffrey Van Wyk

Re: Upgrading through git.

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You definitely don't want to do a merge to handle this - you'll get an enormous number of conflicts between changes that were made in M3.11 after M4.0 was forked off from it and it'll be very hard to keep track of your own changes in the git history.

I'd recommend using the git rebase branch here - create a new Moodle 4.0 branch, initially this will be identical to your existing branch.

Then use "git rebase -i MOODLE_400_STABLE" to transfer all of your changes on top of the new Moodle 4.0 code.

When the text editor pops up, you'll need to remove all the commits that are Moodle core commits (they should be easy to spot, as they all start MDL-nnnn) - these will be commits that were made to M3.11 after M4.0 was created, you just need to get rid of them during the upgrade.

After that, you can close the text editor and let the rebase happen. There's a good chance that you'll hit some conflicts during this process, but, hopefully these will be simple to resolve.
Average of ratings: Useful (2)