Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to continue with rebase due to untracked working tree files would be overwritten by merge error

Tags:

git

I'm currently mergin two branches using git rebase -i, There is a commit that is not letting me continue with the rebase. When I check the commit I see that there are some files but nothing is conflicting with the branch.

enter image description here

I tried using the fixup and edit because I thought maybe I had made some changes, however this is not the case. When I run git rebase --continue I get the following message:

error: The following untracked working tree files would be overwritten by merge:

It also shows files as shown in the image above with the following message

Please move or remove them before you merge.
Aborting
hint: Could not execute the todo command
hint: 
hint:     pick 430847f3fe3f80162a93f62db3e016f3c9a97cc1 Include html2text package
hint: 
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint: 
hint:     git rebase --edit-todo
hint:     git rebase --continue

What can I do in this case? Does this mean, I can rebase this commit? Do I have to abort?

like image 798
Steven Aguilar Avatar asked Oct 16 '22 10:10

Steven Aguilar


1 Answers

error: The following untracked working tree files would be overwritten by merge:

This means exactly what it says: some file(s) exist in your work-tree but not in your index, so they are untracked. Proceeding with the next git cherry-pick that is part of the git rebase sequence will overwrite them. (The main tricky bits here are that git rebase mainly consists of a series of git cherry-pick commands, and that git cherry-pick uses Git's merge mechanism, so that even though you're doing a git rebase you are getting some files merged.)

... But I don't see those file in the folder it says the are. There is no vendor/soundasleep folder when I check atom ...

That's the truly puzzling part. Git definitely sees the files as existing in your work-tree. Note that if you're on a typical Windows or MacOS system, the underlying file system does case-folding, so if there is a vendor/SoundAsleep folder, or a VENDOR/soundasleep folder, or anything along those lines, that also counts.

(I don't use the atom editor and would do any inspecting outside it, myself.)

like image 153
torek Avatar answered Nov 04 '22 19:11

torek