3

Ages ago I installed Moodle from a tarball and have been customizing it in a private git repo ever since (mostly via modules, but I'm not 100% sure I never changed the base code). Now I want to integrate their upstream repo in a way that will let me get updates while preserving my change history, and will notify me if I've made any changes that conflict with the base code.

My problem is that when I try to merge in the remote repository, git doesn't understand that the two repos contain the same code, and treats every file as an add/add conflict. I want to make it so that git will merge these anyway, and only leave the actual conflicts for me to deal with.

What I've done so far:

  1. git add remote moodle git://git.moodle.org/moodle.git
  2. git fetch moodle
  3. git checkout -b upstream_sync v2.2.1 # tag for the version on which my repo was based (it seemed prudent to get that sync'd up first, then start pulling down later updates; maybe that's not necessary, though?)
  4. git merge master

Example output from git merge (I see this for every file):

Auto-merging admin/process_email.php
CONFLICT (add/add): Merge conflict in admin/process_email.php

I could go git mergetool and review every merge manually, but I'd really like to avoid that tedium. Thanks in advance to anyone who can help!

2
  • 4
    It looks like doing a git merge -ssubtree master did the merge more sanely. So far, this seems to have solved the problem. Aug 19, 2013 at 21:42
  • If that answers your question, please post your own answer and mark it as accepted. Nov 13, 2013 at 23:07

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.