转自:http://blog.csdn.net/leeagle/article/details/7818897
如果只在本地修改,还没有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,将本地的master分支推送到origin主机的master分支:
Counting objects: 24, done.
Compressing objects: 100% (13/13), done.
Writing objects: 100% (13/13), 1.13 KiB, done.
Total 13 (delta 11), reused 0 (delta 0)
To git@192.168.1.100:testgit
568aeb4..176b2ad master -> master
之后,再用git staus,打印信息为:
# On branch master
nothing to commit (working directory clean)