直接删除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
相关推荐
慕容引刀7 分钟前
告别Commit信息纠结:使用Git AI Commit插件实现规范化提交
人工智能·git·github·visual studio code·visual studio
GoGeekBaird9 小时前
我开源了 BeeWeave,给 AI Agent 搭一个越用越懂你的知识创作台
后端·github
fthux10 小时前
GitZip Pro 源码解析:一个 GitHub 文件/文件夹下载扩展是如何工作的(一)整体架构与扩展入口
人工智能·ai·开源·github·open source
第一程序员11 小时前
Rust Agent 子进程执行:Command 之前,先定义输入和超时
python·rust·github
2501_9369603613 小时前
GitHub初步了解
github
wangruofeng14 小时前
11 万 Star 的生成式 AI 入门课,Microsoft 做对了什么
github·aigc·ai编程
IOT那些事儿14 小时前
GitHub Profile 429: Too Many Requests
github·profile·429
峰向AI15 小时前
Agent 看不了视频?这个 7K Star 的开源插件一招搞定
github
程序员吕洞宾15 小时前
开源多维表格SmartTable V1.6:自动化工作流,把重复操作交给系统即可
开源·自动化·github·多维表格·飞书多维表
zqx_715 小时前
【无标题】
github