直接删除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
相关推荐
冬奇Lab4 小时前
一天一个开源项目(第35篇):GitHub Store - 跨平台的 GitHub Releases 应用商店
开源·github·资讯
Jahzo6 小时前
openclaw桌面端体验--ClawX
人工智能·github
逛逛GitHub8 小时前
6个粉丝推荐的 GitHub 项目,收藏一波。
github
MaoPou12 小时前
Hello Haxe篇
github
Bigger15 小时前
为什么你的 Git 提交需要签名?—— Git Commit Signing 完全指南
git·开源·github
慢慢开始吧1 天前
Redmi Note 7 Pro (Violet) 爆改满血 Linux 掌上服务器指南
github
模型时代1 天前
GitHub Codespaces存在RoguePilot漏洞,可致GitHub令牌泄露
github
webkubor1 天前
AI 时代的 robots.txt:深度解析 llms.txt 规范与项目“AI 原生化”改造实战
github
i学长的猫1 天前
obsidian md github站点
github
jack@london1 天前
使用Railway
github