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?
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.
To fix this error, either add the files causing the error to the staging area or ignore them using the . gitignore file.
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With