Git is a distributed version control system.
Git is free software.
运行命令:
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")
用git status 掌握当前状态,上面的命令告诉我们,readme.txt被修改过了,但还没有准备提交的修改。
用git diff 查看修改
diff --git a/readme b/readme
index 46d49bf..9247db6 100644
--- a/readme+++ b/readme@@ -1,2 +1,2 @@-Git is a version control system.+Git is a distributed version control system.
Git is free software.
重新提交:
git add readme
查看一下status
On branch master
Changes to be committed:
(use"git reset HEAD <file>..."to unstage)
modified: readme