Git学习——查看修改记录

查看修改结果

  修改之前commit的文件,输入下面的而命令,可以查看文件的改动,输入下面命令。还可以采用git diff命令来看看具体修改了什么。

  如果确认无误,添加add和提交commit文件。

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
warning: LF will be replaced by CRLF in readme.txt.
The file will have its original line endings in your working directory.
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.

  

  

猜你喜欢

转载自www.cnblogs.com/cjvae/p/9164051.html