直接删除Github上的文件

直接删除Github上的文件

说明:此操作只删除Github上的文件,本地仓库文件不受影响

1.确定要删除哪个分支文件,以删除main为例,

1.找到本地仓库位置以StudyNote为例,右键 bash here

2.打开命令窗口,将Github的StudyNote文件全部拉取到本地仓库

css 复制代码
git pull origin main

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

9.将远程仓库文件推送

css 复制代码
git push
相关推荐
我命由我123458 小时前
Git 推送报错:error: src refspec main does not match any
运维·git·gitee·github·运维开发·学习方法·版本控制
阿里嘎多学长9 小时前
2026-09-20 GitHub 热点项目精选
开发语言·程序员·github·代码托管
峰向AI10 小时前
skill-up: [阿里开源] 让 AI Agent Skills 自己进化的评估工具
github
子林super14 小时前
顺序表用Python3定义与增删改查
github
子林super14 小时前
Python非空判断与类型检查写法
github
子林super14 小时前
Python list与array关键区别及使用场景
github
子林super14 小时前
Python中None与null的区别
github
u13013016 小时前
GitHub 热榜项目:周榜(2026-09-20)
人工智能·github
u13013017 小时前
GitHub 热榜项目:日榜(2026-09-20)
人工智能·github
逛逛GitHub18 小时前
外网 3500 万人围观的 Jev 模型,有这 10 个神奇玩法。
github