We track the upstream Moodle code by adding the Moodle Git repository as a remote to our repo and then merging our branches with MOODLE_21_STABLE. This seems to work. We can make small changes to core code, and still track the upstream code easily.
But yesterday I tried to merge ou Moodle21 based branch with the new upstream MOODLE_22_STABLE branch and that led to problems. I did
git merge -s recursive -X theirs origin/upstream22
but the problem is that the same code is committed twice, in the 2.1 and 2.2 branches of the Moodle code (example: commit in 2.1, commit in 2.2 ). I think this makes it impossible to do what I tried to do: upgrade to 2.2 doing a merge with my 2.1 based branch: how is git going to understand that the two commits are the same code?
If my understanding is correct, how should I upgrade our 2.1 based branch?