Pages

Merge renamed folders in git

Saturday, May 3, 2014

On the master branch there is a directory dir1. Some feature branch was outgoing from the master branch and changed some files in dir1.

Meanwhile in the masterbranch the directory dir1 was renamed to dir2. Now I want to merge the feature branch to the master branch. The result should be that both directories should exist in the master branch.

Unfortunately git is unable to do so with simple commands. Since it tracks the content it tries to put the changes from the files in dir1 to dir2. How to tell git to do so?