直接删除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
相关推荐
darkb1rd11 小时前
OpenMythos:从零重构大模型架构实战指南
开源·github·好物分享
弑神风11 小时前
GitHub Copilot vs Cursor深度横评(2026):谁是AI编程之王?
程序员·github·copilot·ai编程·cursor·工具测评
CoderJia程序员甲11 小时前
GitHub 热榜项目 - 日榜(2026-04-25)
ai·大模型·llm·产品运营·github·ai教程
zh_xuan13 小时前
把Android Library 上传到github并在工程中引用该远程仓库
android·github·远程仓库
盖丽男13 小时前
使用 GitHub Actions 自动打包 Android APK
android·github
七颗糖很甜13 小时前
预警!超级厄尔尼诺即将登场:2026-2027年全球气候或迎“极端狂暴模式”
java·大数据·python·算法·github
zhensherlock15 小时前
Protocol Launcher 系列:Working Copy 文件操作与高级命令详解
javascript·git·typescript·node.js·自动化·github·js
Dawn·张1 天前
Unity小:GitHub部署静态网页
github
玖玖passion1 天前
Windows 上部署 Hermes Agent 完整指南 - 让你的 AI 助手在 WSL2 中跑起来
前端·后端·github
AC赳赳老秦1 天前
OpenClaw实战案例:用Agent实现每日工作日报自动生成+发送
人工智能·python·职场和发展·eclipse·github·deepseek·openclaw