如何删除github上的文件或文件夹?
我正在开发一个 python 项目,并将其保存在 github 上。我最近更新了它,试图更改文件夹的名称。然而,它实际上只是再次添加了该文件夹,而没有更改另一个文件夹。有什么办法可以删除旧文件夹吗?以后有没有更好的方法来更改文件名?
这是项目: https://github.com/bMacSwigg/The-Legend-村里的 我用 LotV.exe-WSE 替换了 exe.win32-2.7,现在我想删除 exe.win32-2.7。
I have a python project I'm working on, and I'm keeping it on github. I recently updated it, trying to change the name of a folder. However, it actually just added the folder again without changing the other one. Is there a way I can delete the old folder? In the future, is there a better way to change the name of a file?
This is the project: https://github.com/bMacSwigg/The-Legend-of-The-Village
I replaced exe.win32-2.7 with LotV.exe-WSE, and now I want to delete exe.win32-2.7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您移动文件夹或重命名它时,
这将暂存所有更改 - 包括删除。执行此操作后,您将看到您现在已经采取了行动。
将来你可以
git add -A 将此视为一个举动。
when you move the folder or rename it
this will stage all changes - including deletions. Committing this, you will see that you now have a move.
In the future you can
and git add -A will see this as a move.
Adam 的答案将使您的项目从当前状态进入正确状态。为了将来参考,您可以通过使用 git 进行重命名来避免此问题:
Adam's answer will get your project from it's current state into the correct state. For future reference, you can avoid this problem by using git to do the renaming: