git 如何从git repo中删除一个文件夹?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26838177/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to delete one folder from git repo?
提问by ifusion
I have a folder called "Serverside Project" that I want to delete from my git repo online. I can't seem to be able to get rid of it! How do I remove it?
我有一个名为“Serverside Project”的文件夹,我想从我的 git 在线仓库中删除它。我似乎无法摆脱它!如何删除它?
回答by Mauricio Trajano
You can just delete the folder locally and then push, ex:rm -rf folder
git add .
git commit -a -m "removed folder"
git push origin master
您可以在本地删除该文件夹然后推送,例如:rm -rf folder
git add .
git commit -a -m "removed folder"
git push origin master