git status命令的使用

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

 

 

 

posted on 2013-04-25 00:48  只愿软禁  阅读(556)  评论(0)    收藏  举报