Stella
Stella

Reputation: 149

Git pull on local does not remove already deleted files

I have a couple different user accounts. They all pull from the same github repo.
Some files are deleted in a git commit and merged into master.

For some reason, under one user, "git pull" does not sync the deleted file. It gets other changes from the same commit, but does not delete local files that are already deleted in remote master.

Git pull works fine in my other user accounts, but only behaves weirdly with this particular one. Can someone tell me why?
Is it a permission issue that git does not have permission to delete files in this folder? If so, how do I confirm that?

Upvotes: 6

Views: 4077

Answers (1)

VonC
VonC

Reputation: 1329542

The first test would be to re-clone that repo from the problematic user's workstation.

Check if the content is correct, and consider working from that new clone (after moving the old clone, and renaming the root folder of the new clone, if you don't want to change path).

Maybe some files from the old clone were preempted by a running program, and could not be deleted.

The OP Stella adds in the comments:

The problematic user account is my deployment account.
My mind got blown away that someone deleted an entire folder in my repo but my code still ran as normal. Then I realized git pull indeed deleted the .py files, but since .pyc files were ignored, they are still under that folder and was supporting the rest of the code as it used to be.
Since nobody uses that user account to run test code, the .pyc files never got refreshed.

Upvotes: 1

Related Questions