Hi all,

we have a repository with essentially this commit graph:

       o---o---o---...---o---o---D   <-- develop
      /       /         /
 o---o---o---o---...---M             <-- master

As shown, we occasionally merge "master" into "develop", but never vice-versa. (We create our releases off the "develop" branch, not "master".)

Now we have found a need to reorganize our files and directories, moving "everything" into a new subdirectory "www", for example like this:

    # Git version is 1.7.11.msysgit.1 on Windows 7.
    # At the top of the working tree:
    mkdir www/

    git mv forum/ www/
    git mv images/ www/
    git mv templates/ www/
    git mv index.php www/

    git commit -m "Moved everything into www/."

This is easy, but the problem is that we eventually have to do this *both* in "develop" *and* in "master", in order to be able to do future merges from "master" into "develop" as before.

The question is how?

I tried the above move-and-commit commands first at commit M, yielding new commit N, then to merge this into "develop" in order to obtain E:

       o---o---o---...---o---o---D ---E    <-- develop
      /       /         /            /
 o---o---o---o---...---M -----------N      <-- master

but this yields plenty of merge conflicts, probably because D has several files in various directories that M doesn't have, and several files with small changes as well.

So I deleted E again (reset "develop" back to D), repeated the above move-and-commit commands at D in order to mimic things in the "develop" branch, obtaining F, and *then* tried to merge "master" into "develop" to obtain G:

       o---o---o---...---o---o---D ---F ---G   <-- develop
      /       /         /                 /
 o---o---o---o---...---M -----------N ---ยด     <-- master

To my surprise, this caused conflicts for quasi every of the affected 11000 files as well. Unfortunately I didn't keep a copy of the exact messages, but essentially the reported conflict was that the file has been renamed on one side, and has been renamed on the other side as well.

What can we do?

Best regards,

   Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
          Learn more at http://www.cafu.de


Reply via email to