Git is a distributed version control system.
Git is free software distributed under the GPL.
Git has a mutable index called stage.
Git tracks changes.
然后添加:
git add readme
git status
On branch master
Changes to be committed:
(use"git reset HEAD <file>..."to unstage)
modified: readme
然后,再次修改readme
cat readme
Git is a distributed version control system.
Git is free software distributed under the GPL.
Git has a mutable index called stage.
Git tracks changes offiles.
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: readme
no changes added to commit (use"git add"and/or"git commit -a")
发现并没有被提交 还记得吗?如果在暂存区没有东西,都提交到分支的化,那么应该是“On branch master nothing to commit, working tree clean”了。。。。
On branch master
Changes not staged for commit:
modified: readme
no changes added to commit
因为并没有添加到暂存区
这里查看工作区和版本库的区别:
git diff HEAD -- readme
diff --git a/readme.txt b/readme.txt
index a9c5755..dfc0e83 100644
--- a/readme.txt+++ b/readme.txt@@ -1,4 +1,4 @@
Git is a distributed version control system.
Git is free software distributed under the GPL.
Git has a mutable index called stage.
-Git tracks changes.+Git tracks changes of files.