直接删除Github上的文件
说明:此操作只删除Github上的文件,本地仓库文件不受影响
1.确定要删除哪个分支文件,以删除main为例,
1.找到本地仓库位置以StudyNote为例,右键 bash here
2.打开命令窗口,将Github的StudyNote文件全部拉取到本地仓库
css
git pull origin main
![](https://i-blog.csdnimg.cn/direct/586a410df500483496784a43d55d8e71.png)
3.若不是main主分支,使用checkout切换
css
git checkout 目标分支名
4.查看拉取项目所有文件夹
css
dir
5.要删除main主分支的Issue.md文件,切换到其所在为止Auto_test/Python/Issue.md
6.删除tIssue.md文件
css
git rm -r --cached target
7.删除文件后提交
css
git commit -m '删除Issue.md' # 提交,添加操作说明
8.查看该文件是否删除
css
dir
![](https://i-blog.csdnimg.cn/direct/30f8206ecc4a44b1980531f14a7f72d9.png)
9.将远程仓库文件推送
css
git push
![](https://i-blog.csdnimg.cn/direct/ce39ad08a8864b4882a643743ceb5834.png)