我从本地仓库删除了python .pyc文件,我认为我做的是从远程github删除。
我推动了所有变化。这些文件仍然在repo上,但不在我的本地机器上。如何从github repo中删除文件?
我尝试了以下内容:
git rm classes/file.pyc
git add .
git
甚至:
git rm --cached classes/file.pyc
然后,当我尝试检出文件时,我收到了这个错误。
enter code here`error: pathspec 'classes/redis_ha.pyc' did not match any file(s) known to git.
我现在不知道还能做什么。截至目前,我有一个完全损坏的git repo。
答案 0 :(得分:29)
你不应该git add
。这就是全部
git rm classes/file.pyc
git commit -m"bla bla bla"
git push
答案 1 :(得分:-1)
git commit -am "A file was deleted"
git push