I want to merge in a branch in which a directory has been moved, and I have added files in this directory in my branch. However, when I tried to do this, the new files in my branch were not moved to the new directory.
I am not sure whether this is relevant, but an additional complication in this repository is that the "new" directory used to exist as well, and the other branch simultaneously deleted the old version of the new directory and moved the old directory over the top of it. The presence of the old version of the new directory was due to a misuse of directories in our repository for versioning purposes, which should really have been handled by git instead, but it was a convenient thing to do at the time.
So, how can I, while doing an "interactive merge" (i.e. solving a merge conflict or using git merge --no-commit
), find all the files that are new and move them to the new directory?
The problem is, that while in this "merging state":
- The files to be deleted during the merge, are not actually deleted yet. I don't want to move them over to the new directory, because I am worried that they are possibly outdated versions of those files.
- There are also some ignored files in the old directory. I don't want to move them over either.
git status
doesn't show the new files as added, because they are not - they were already committed to the current branch.- The files in question actually exist in the working tree in both the new and the old directory, although they don't seem to be registered with git in the new directory (a possible git bug? I am confused about what is happening here)