I'm a git newbie and am having an annoying error. I've spent a few hours going through different posts on StackOverflow to see how other users solved this, but nothing is working for me.
When pulling from the repo, I get the following error:
error: The following untracked working tree files would be overwritten by merge: upload/.DS_Store
git add .
, git stash
, git pull
and still got the error..gitignore
, but I still get the error.I have no idea what to do.
Somebody has added the file already and pushed in the changes you are trying to merge during pull. In most cases it is a mistake.
If you have write access to the repository, remove the file as soon as possible from there. Then merging should succeed.
How to remove them: Github allows to remove files this from web interface, for example. If you cannot do it from web, clone the master branch, call git rm
on the file, commit and push. Even if they are auto created, repository will remember them as removed.
Make sure you do no add them again (add the filename to .gitignore)
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