赞
踩
说明:本文方法在2023-02-13当天Windows 10 64位系统下亲测有效,其它系统暂时未知,如有小伙伴测试成功可以在评论区留言哦!
在一个空文件夹下,右键Git Bash Here
git clone 仓库地址
,比如 git clone https://github.com/username/test1.git
cd test\
进入test文件夹,输入git rm -rf *
命令,删除本地除.git
外的所有文件(必须要有.git文件其余git命令才有效)git commit -m 'Empty the repository'
命令,提交清空信息到本地仓库git push
命令,推送到远程仓库git push -u origin main -f
(main有时可以换成master)PS:之前自己找了好久,最后在Google搜索下找到了这个方法,在此整理后分享一下
参考链接:https://lele3.github.io/2018/11/07/删除远程仓库文件夹或文件.html
在一个空文件夹下,右键Git Bash Here
git clone 仓库地址
,比如 git clone https://github.com/username/test.git
cd test\
进入test文件夹,输入git rm -r --cached 文件名
命令,例如git rm -r --cached public
rm 'public'
,说明删除成功;接下来输入```git commit -m '删除public文件’提交到本地仓库如下图4.输入git push
推送到远程仓库后刷新即可
参考链接:https://blog.csdn.net/ingenuou_/article/details/107452638
版权声明: 转载前需要经过作者同意。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。