修改之前提交的README.md,我用vim编辑器,你也可以用其他的或者用可视化界面的文本编辑器
vim README.md随便写点东西到文件,如:
write something用status查看当前状态
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.md
no changes added to commit (use "git add" and/or "git commit -a")以上内容主要提示 README.md 被修改过了,但是还没有add。用diff看看改了哪里
git diff输出:
diff --git a/README.md b/README.md
index e69de29..da7a5c3 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1 @@
+write something
(END)表明添加了内容: write something
然后再使用add和commit提交新的内容
git add README.md
git commit -m 'first release'再使用 status 查看一下状态
git status打印:
On branch master
nothing to commit, working tree clean说明都提交了,工作目录是干净的。
要随时掌握工作区的状态,使用git status命令。如果git status告诉你有文件被修改过,用git diff可以查看修改内容。