直接删除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
相关推荐
念丶小宇8 小时前
Github上传大文件
github
极智-99612 小时前
GitHub 热榜项目-日榜精选(2026-02-03)| AI智能体、终端工具、RAG技术等 | claude-mem、99、termux-app等
人工智能·网络安全·github·ai智能体·llm应用·rag技术·torrent工具
骂我的人都死了13 小时前
DevOps架构部署
运维·ubuntu·docker·k8s·github·devops·python3.11
Alaaaaaaan13 小时前
[DevOps]使用github-action工具部署docker容器(实现提交代码一键推送部署到服务器)
服务器·前端·docker·容器·github
CryptoRzz14 小时前
德国股票数据 API 对接实战(DAX 指数与实时行情)
websocket·区块链·github·分布式账本
Tipriest_14 小时前
GitHub Gist 功能详解:从入门到进阶
github·gist
困惑阿三15 小时前
CloudflarePages+GitHub零成本博客搭建手册
github
猫头虎17 小时前
2026全网最热Claude Skills工具箱,GitHub上最受欢迎的7大Skills开源AI技能库
langchain·开源·prompt·github·aigc·ai编程·agi
CoderJia程序员甲17 小时前
GitHub 热榜项目 - 日榜(2026-02-03)
git·ai·开源·llm·github
MicrosoftReactor19 小时前
技术速递|使用 GitHub Copilot SDK 将智能体集成到任何应用中
ai·github·copilot