更新时间:2022-06-02 05:22:58
$ 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
$ git add -A warning: LF will be replaced by CRLF in a.txt. The file will have its original line endings in your working directory Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master) $ git status On branch master No commits yet Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: a.txt Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master) $ git commit -m "第一次提交 a.txt" a.txt warning: LF will be replaced by CRLF in a.txt. The file will have its original line endings in your working directory [master (root-commit) 272a9cd] 第一次提交 a.txt 1 file changed, 9 insertions(+) create mode 100644 a.txt Administrator@SD-20191128LXMQ MINGW64 /d/gitRepos/repo1 (master) $ git status On branch master nothing to commit, working tree clean