Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio git message: following untracked working tree files would be overwritten by merge, but not showing which files

I'm working on an android project in android studio and using VCS for working on git with the other members of the team. Last time I tried to pull from origin, the following error came up: "following untracked working tree files would be overwritten by merge", but it doesn't show me any file that caused the error. I checked and every class and file in the project is added to git, so I don't know what the problem could be. The change I've done was creating the folder "drawable" under the folder "res" and added an image that I use in the app; both was added to git. What should I do?

like image 830
Usr Avatar asked May 15 '15 18:05

Usr


People also ask

Could not merge the following untracked working tree files would be overwritten by merge?

The reason of getting this error:” the following untracked working tree files would be overwritten by merge” is that you're not tracking the files locally but there might be a chance that the identical files are tracked by the remote.

How do I fix nothing added to commit but untracked files?

To fix this error, either add the files causing the error to the staging area or ignore them using the . gitignore file.

How do I stop untracked files in git?

Git can only ignore files that are untracked - files that haven't been committed to the repository, yet. That's why, when you create a new repository, you should also create a . gitignore file with all the file patterns you want to ignore.


1 Answers

When you pull files from a remote branch your working directory should be clean. Try git status(check if there are modified files in your working directory) -- it will show a list of files. Stash the changes/ reset them and try pulling again. This time it will work!

like image 195
Naveen Dennis Avatar answered Oct 01 '22 15:10

Naveen Dennis