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.
假设我们已经掌握了暂存区的概念,本节会更深入的理解Git的修改过程。。。。。廖雪峰官网教程中对修改的定义是:比如你新增了一行,这就是一个修改,删除了一行,也是一个修改,更改了某些字符,也是一个修改,删了一些又加了一些,也是一个修改,甚至创建一个新文件,也算一个修改。继续跟着官网做实验吧。。。。在readme里面加一行Git is a distributed versio