Reputation: 8211
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 master
branch 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?
Upvotes: 1
Views: 61
Reputation: 12393
I'd try the following before having done the merge:
git merge --no-commit
git checkout feature -- dir1/
git checkout master -- dir2/
git commit
. With --no-commit
you force git to create the commit automatically if there are no conflicts.
Upvotes: 1