如果只在本地修改,還沒有commit,那麼用git status, 打印信息爲:
# On branch master
# 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: conf/gitolite.conf
#
no changes added to commit (use "git add" and/or "git commit -a")
commit之後,用git status,打印信息爲:
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit (working directory clean)
說明沒有文件需要commit,但是本地倉庫 有一個commit ahead原來的master,就是本地倉庫有一個提交,比遠程倉庫要先進一個commit。git push origin master之後,再用git staus,打印信息爲:
# On branch master
nothing to commit (working directory clean)