直接删除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
相关推荐
可乐要加冰^-^6 分钟前
云雀文档下载
windows·git·github·石墨文档
江畔柳前堤10 分钟前
github实战指南00-命令在哪里执行?
人工智能·线性代数·oracle·数据挖掘·github·word
IT 行者14 分钟前
GitHub Spec Kit 实战(三):写一份能管住所有 spec 的 /speckit.constitution
java·github·ai编程·claude
IT 行者17 分钟前
GitHub Spec Kit 实战(二):写一份不偏的 /speckit.specify
java·github·ai编程·claude
NaclarbCSDN31 分钟前
我写了一个命令行书签管理器,然后抛弃了浏览器书签栏
linux·git·python·github
IT WorryFree1 小时前
GitHub Actions 流水线注入敏感配置完整方案(Antora + Docker Compose)
docker·容器·github
江畔柳前堤1 小时前
github实战指南05-Fork与开源协作
人工智能·线性代数·oracle·开源·github·word
朱涛的自习室1 小时前
Harness 还没学会,又来了个 Loop Engineering ?
android·人工智能·github
CoderJia程序员甲2 小时前
GitHub 热榜项目 - 周榜(2026-06-14)
ai·大模型·llm·github