直接删除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
相关推荐
CoderJia程序员甲9 小时前
GitHub 热榜项目 - 日榜(2025-12-24)
ai·开源·llm·github
逛逛GitHub17 小时前
国产AI大模型 Minimax M2.1效果相当惊艳,赶紧试试
github
-拟墨画扇-18 小时前
Git | 文件提交操作
git·gitee·github·gitcode
CoderJia程序员甲18 小时前
GitHub 热榜项目 - 日榜(2025-12-25)
git·ai·开源·llm·github
A132470531219 小时前
进程管理入门:查看和控制Linux进程
linux·运维·服务器·网络·chrome·github
-拟墨画扇-19 小时前
Git | 文件修改操作
大数据·git·gitee·github·gitcode
-拟墨画扇-19 小时前
Git | 版本控制操作
大数据·git·gitee·github
一条闲鱼_mytube19 小时前
GitHub K8S CI/CD 部署指南
github
lyx_201620 小时前
尝试理清楚Github fork, tag, release和PR
github
xuhe21 天前
[重磅更新] 支持最新 Overleaf 6.x!我的私有化部署方案 xuhe2/sharelatex-ce 迎来大升级
linux·docker·github·科研·overleaf