git status 可以查看文档的改变与否,千万不能上来就按git add ,否则看不到
例子:
$ git status readme.txt(只查看了readme.txt)//git status 可以查看仓库里所有的
On branch master
Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git checkout – …” to discard changes in working directory)
modified: readme.txt
no changes added to commit (use “git add” and/or “git commit -a”)
modified: readme.txt 系统判断readme.txt更改过
$ git add readme.txt
$ git status readme.txt
无任何反应
修改之后可以使用 git diff 查看改动
$ git status
On branch master
nothing to commit, working tree clean
Git告诉我们当前没有需要提交的修改,而且,工作目录是干净(working directory
clean)的。