如果我们对readme.text做以下改动
Git is a distributed version control system.
Git is free software.
会发生什么呢,我们可以通过这两个命令来查看他们的变化
staus命令
Administrator@PC-20140823TXAB MINGW64 /c/learngit (master)
$ 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.txt
no changes added to commit (use "git add" and/or "git commit -a")
Administrator@PC-20140823TXAB MINGW64 /c/learngit (master)
$
satus命令可以让我们时刻掌握仓库当前的状态,上面的命令告诉我们,readme.txt被修改过了,但还没有准备提交的修改。
git diff命令
git diff顾名思义就是查看difference
$ git diff
diff --git a/readme.txt b/readme.txt
index d8036c1..ee2c1ea 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,2 +1,2 @@
-Git is a version control system.
-Git is free software.
\ No newline at end of file
+Git is a distributed version control system.
+Git is free software
\ No newline at end of file
Administrator@PC-20140823TXAB MINGW64 /c/learngit (master)
$