How can I delete a file from a Git repository?

后端 未结 24 2332
無奈伤痛
無奈伤痛 2020-11-22 13:41

I have added a file named \"file1.txt\" to a Git repository. After that, I committed it, added a couple of directories called dir1 and dir2

24条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 14:10

    If you need to remove files from a determined extension (for example, compiled files) you could do the following to remove them all at once:

    git remove -f *.pyc
    

提交回复
热议问题