Git(5)——查看修改内容
在Git中使用git status等命令来查看文件的变动
![](https://csdnimg.cn/release/devpress/public/img/ic-book.4f347164.png)
一键AI生成摘要,助你高效阅读
问答
·
- 将readme.txt文件改为以下内容
Git is a distributed version control system.
Git is free software.
- 运行
git 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.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
- 可以使用
git diff
这个命令来看看更改的地方(difference)
$ git diff readme.txt
diff --git a/readme.txt b/readme.txt
index 46d49bf..9247db6 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,2 +1,2 @@
-Git is a version control system.
+Git is a distributed version control system.
Git is free software.
更多推荐
所有评论(0)