Changes to be committed: (use "git rm --cached <file>..." to unstage) new file: test1.txt
Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) deleted: test1.txt
执行git log
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
> git log fatal: your current branch 'master' does not have any commits yet
> git status On branch master Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: dir/test1.txt new file: dir/test2.txt
Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) deleted: dir/test1.txt deleted: dir/test2.txt deleted: test1.txt
> git restore --staged dir/test1.txt > git status On branch master Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: dir/test2.txt
Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) deleted: dir/test2.txt deleted: test1.txt
> git update-ref refs/heads/master aac8d22b2a4ce4a30c9e39fef0ed7cdf19e29171 > git status On branch master Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) deleted: dir/test2.txt deleted: test1.txt
no changes added to commit (use "git add" and/or "git commit -a")