$ vi a $ 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: a
no changes added to commit (use "git add" and/or "git commit -a") $ git diff diff --git a/a b/a index 64fa4ac..6780600 100644 --- a/a +++ b/a @@ -1 +1 @@ -sssssssiaaaiiiaaaaaa +Hello,I'm a. $ vi commit1 #修改commit1文件 $ git diff #可以查看到所有修改文件的差异 diff --git a/a b/a index 64fa4ac..6780600 100644 --- a/a +++ b/a @@ -1 +1 @@ -sssssssiaaaiiiaaaaaa +Hello,I'm a. diff --git a/commit1 b/commit1 index e69de29..33f9a70 100644 --- a/commit1 +++ b/commit1 @@ -0,0 +1 @@ +Hello,I'm commit1. $ git diff -- a #这里可以使用“--“过滤想要看到的文件名 只看a文件的差异 diff --git a/a b/a index 64fa4ac..6780600 100644 --- a/a +++ b/a @@ -1 +1 @@ -sssssssiaaaiiiaaaaaa +Hello,I'm a. $ git diff -- a commit1 diff --git a/a b/a index 64fa4ac..6780600 100644 --- a/a +++ b/a @@ -1 +1 @@ -sssssssiaaaiiiaaaaaa +Hello,I'm a. diff --git a/commit1 b/commit1 index e69de29..33f9a70 100644 --- a/commit1 +++ b/commit1 @@ -0,0 +1 @@ +Hello,I'm commit1.
|