如何删除文件? #3

Closed
opened 2023-12-12 14:10:47 +08:00 by suneshone · 1 comment
Owner

可以用 git rm 命令完成此项工作

如果要删除之前修改过或已经放到暂存区的文件,则必须使用强制删除选项 -f (译注:即 force 的首字母)。 这是一种安全特性,用于防止误删尚未添加到快照的数据,这样的数据不能被 Git 恢复。

可以用 `git rm` 命令完成此项工作 如果要删除之前修改过或已经放到暂存区的文件,则必须使用强制删除选项 `-f` (译注:即 force 的首字母)。 这是一种安全特性,用于防止误删尚未添加到快照的数据,这样的数据不能被 Git 恢复。
suneshone self-assigned this 2023-12-12 14:10:47 +08:00
suneshone added this to the 学习git的使用 project 2023-12-12 14:10:47 +08:00
suneshone added the due date 2023-12-12 2023-12-12 14:10:56 +08:00
Author
Owner

你想让文件保留在磁盘,但是并不想让 Git 继续跟踪。 当你忘记添加 .gitignore 文件,不小
心把一个很大的日志文件或一堆 .a 这样的编译生成文件添加到暂存区时,这一做法尤其有用。 为达到这一目
的,使用 --cached 选项

git rm --cached README
你想让文件保留在磁盘,但是并不想让 Git 继续跟踪。 当你忘记添加 .gitignore 文件,不小 心把一个很大的日志文件或一堆 .a 这样的编译生成文件添加到暂存区时,这一做法尤其有用。 为达到这一目 的,使用 --cached 选项 ```shell git rm --cached README ```
suneshone added the
question
label 2023-12-12 15:18:28 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

2023-12-12

Dependencies

No dependencies set.

Reference: suneshone/obscuredSubtitles#3
No description provided.