remove - what happens when we delete a file and push new commits to a git repository




How to remove files from the GitHub repository? (2)

You should not do git add. That's all

git rm classes/file.pyc
git commit -m"bla bla bla"
git push

I deleted python .pyc files from my local repo and what I thought I did was to delete from remote github.

I pushed all changes. The files are still on the repo but not on my local machine. How do I remove files from the github repo?

I tried the following:

git rm classes/file.pyc
git add .
git 

and even:

git rm --cached classes/file.pyc

Then when I try and checkout the files I get this error.

enter code here`error: pathspec 'classes/redis_ha.pyc' did not match any file(s) known to git.

I now dont know what else to do. As of now I have a totally corrupted git repo.


git commit -am "A file was deleted"
git push




github