git init之后使用git status的情况:
git init Initialized empty Git repository in /home/mycode/myGit/testGit2/.git/git status # On branch master # # Initial commit # nothing to commit (create/copy files and use "git add" to track)
新创建了文件,没有使用git add命令的情况:(Untracked 没有跟踪)
git status # On branch master # # Initial commit # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # test nothing added to commit but untracked files present (use "git add" to track)
git add这个文件之后的状态:(Changes to be committed)
git add test git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: test #
修改这个git add过的文件之后的状态:(not staged)
git status # On branch master # # Initial commit # # Changes to be committed: # (use "git rm --cached <file>..." to unstage) # # new file: test # # Changes not staged for commit: # (use "git add <file>..." to update what will be committed) # (use "git checkout -- <file>..." to discard changes in working directory) # # modified: test
总结:没有git add的文件的状态是未跟踪,git add之后的文件是Changes to be committed,修改git add过的文件的是Changes not staged for commit
浙公网安备 33010602011771号