From 756beab203755ec50e6a81f75aa648aa08b6673a Mon Sep 17 00:00:00 2001 From: Mhrooz Date: Sat, 17 Aug 2024 21:49:48 +0200 Subject: [PATCH] update 2.7.2 --- notes/2.7-git_basic_op.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/notes/2.7-git_basic_op.md b/notes/2.7-git_basic_op.md index 93ef115..04b8727 100644 --- a/notes/2.7-git_basic_op.md +++ b/notes/2.7-git_basic_op.md @@ -10,3 +10,19 @@ git describe # 查看标签 ## 2.7.2 Git 删除文件 git + +```bash +rm *.txt +git ls-files #本地删除不是真的删除,暂存库中还在,也就是删除的这个命令没有被添加到暂存库中 +``` + +```bash +git rm welcome.txt hack-2.txt #将文本文件从git中删除 +git status +git ls-files --with-tree=HEAD^ # 父节点中的文件还在 +``` + +```bash +git add -u #将版本库中的本地文件的变更记录到暂存区中 +``` +