bash 从 GitHub 删除文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9246871/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 01:32:32  来源:igfitidea点击:

Deleting a folder from GitHub

bashgithub

提问by test

I'm trying to delete the folder mapeditorfrom my Java engine on GitHub here (https://github.com/UrbanTwitch/Mystik-RPG)

我正在尝试mapeditor从 GitHub 上的 Java 引擎中删除该文件夹(https://github.com/UrbanTwitch/Mystik-RPG)

I'm on Git Bash.. messing around with rmand -rfbut I can't seem to do it. How do I remove mapeditorfolder from Mystik-RPGcompletely?

我正在使用 Git Bash .. 搞砸了rm-rf但我似乎无法做到。如何完全删除mapeditor文件夹Mystik-RPG

Thanks.

谢谢。

回答by fourk

From the Mystik-RPGfolder:

Mystik-RPG文件夹:

git rm -rf mapeditor

回答by Borealid

You need to git rmthe folder, then git committhe removal. Finally, git pushyour new commit to github.

你需要git rm的文件夹,然后git commit删除。最后,git push你对 github 的新提交。

Just deleting the folder won't tell git you wish to have it removed - that would put it into the "tracked but missing" state. You want it to transition to the "untracked" state, which is what git rmis for.

只是删除文件夹不会告诉 git 您希望将其删除 - 这会将其置于“已跟踪但丢失”状态。您希望它转换到“未跟踪”状态,这就是git rm目的。