$ git add b.txt
warning: LF will be replaced by CRLF in b.txt.
The file will have its original line endings in your working directory
Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master)
$ git commit -m "b.txt" b.txt
warning: LF will be replaced by CRLF in b.txt.
The file will have its original line endings in your working directory
[master 4ae6a0c] b.txt
1 file changed, 1 insertion(+)
create mode 100644 b.txt
Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master)
$ git status
On branch master
nothing to commit, working tree clean
Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master)
$ git rm b.txt
rm 'b.txt'
Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master)
$ git status
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: b.txt
Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master)
$ git status
On branch master
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: b.txt
# 注意这里需要重新提交操作
Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master)
$ git commit -m "delete b.txt"
[master d39bee4] delete b.txt
1 file changed, 1 deletion(-)
delete mode 100644 b.txt
Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master)
$ git status
On branch master
nothing to commit, working tree clean