Steven Cheng
Steven Cheng

Reputation: 1081

Git Merge failed referencing missing files

I'm quite new to Git so excuse me if I'm using wrong terminology. I created a develop branch off the master branch which I wanted to use for testing fixes/updates. I then created a new branch called themes which I wanted to merge into develop however I get this error message which I have no idea how to solve:

CONFLICT (rename/delete): Rename files/imagefield_thumbs/advert-photos/favicon.png->sites/all/themes/custom/newtheme origional/images/quote_bottom.png in theme and deleted in HEAD CONFLICT (rename/delete): Rename files/imagefield_thumbs/advert-photos/favicon_0.png->sites/all/themes/custom/newtheme origional/images/quote_top.png in theme and deleted in HEAD

This directory files/imagefield_thumbs/advert-photos doesn't exist on either branches so not sure why this is being flagged?

I also have .gitignore set to ignore files/* as well.

Hope my question makes sense.

Steve

Upvotes: 0

Views: 125

Answers (1)

Schleis
Schleis

Reputation: 43750

There are a couple of things.

Git doesn't track directories, it tracks files. You had a file that it was tracking that got renamed. Or at least it thinks that the file was renamed. And in the branch that you are merging into those files were deleted. So Git is confused as to what you want done with the file, whether the file needs to be moved or it should be deleted.

You have a merge conflict, which is fairly regular occurrence. All you need to do is run git merge-tool and it will allow you to use the file or choose to have it deleted.

Check out the section about merge conflicts. You will want to get comfortable with dealing with them. http://git-scm.com/book/en/Git-Branching-Basic-Branching-and-Merging

As for the git-ignore file, did you have files in the directory when you added that? That may have led to this particular confusion.

Upvotes: 1

Related Questions