Pavan Manjunath
Pavan Manjunath

Reputation: 28525

git pull complains about overwrite even after removing those files on remote repo

My friend accidentally added some obj files on to our remote repo. Now, on my machine, when I tried to do git pull, it complained that these .o files would overwrite mine locally. As those are unnecessary files, I did git rm --cached on every file that git pull complained on.

Even after this, if I do git pull, I am getting the same overwrite errors. My doubt is, I've deleted the unwanted the files from the remote repo itself. Then why is git still complaining about them?

Upvotes: 0

Views: 48

Answers (1)

StenSoft
StenSoft

Reputation: 9609

git rm --cached does not remove any files, it just unstages files so that they won't be committed but they are still left in the working tree. You need either git rm without --cached (to commit the removal to the remote repository) or rm without git (to remove local files).

Upvotes: 1

Related Questions