Administrator@PC-NAME ~/Desktop/ssh/repos/test (master) $ echo 'hello' > test Administrator@PC-NAME ~/Desktop/ssh/repos/test (master) $ git add . warning: LF will be replaced by CRLF in test. The file will have its original line endings in your working directory. Administrator@PC-NAME ~/Desktop/ssh/repos/test (master) $ echo 'hello world' > test Administrator@PC-NAME ~/Desktop/ssh/repos/test (master) $ git diff diff --git a/test b/test index ce01362..3b18e51 100644 --- a/test +++ b/test @@ -1 +1 @@ -hello +hello world warning: LF will be replaced by CRLF in test. The file will have its original line endings in your working directory.
GNU diff 比較兩個文件的不同(self-explanation) # echo 'hello' >test # echo 'hello world' > test2 # diff -u test test2 --- test 2012-01-26 01:56:07.000000000 +0800 +++ test2 2012-01-26 01:56:28.000000000 +0800 @@ -1 +1 @@ -hello +hello world