7

删除 GitHub 仓库中某个文件夹

 3 years ago
source link: https://wiki-power.com/%E5%88%A0%E9%99%A4GitHub%E4%BB%93%E5%BA%93%E4%B8%AD%E6%9F%90%E4%B8%AA%E6%96%87%E4%BB%B6%E5%A4%B9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

删除 GitHub 仓库中某个文件夹

问题来源#

在本地仓库上传到 GitHub 时,忘记忽略某个文件夹,直接 push 到远程仓库了。
如何在保留本地文件夹的同时,删除 GitHub 仓库中的文件夹?

解决方法#

git pull origin master # 先将远程仓库里面的项目拉取下来
dir # 查看有哪些文件夹
git rm -r --cached target # 删除名字为 target 的文件夹
git commit -m '删除了 target' # 添加操作说明并提交

参考与致谢#

文章作者:Power Lin
原文地址:https://wiki-power.com
版权声明:文章采用 CC BY-NC-SA 4.0 协议,转载请注明出处。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK