歡迎您光臨本站 註冊首頁

diff

←手機掃碼閱讀     火星人 @ 2014-03-03 , reply:0


在看<> 時偶然發現裡面提到的一個GNU tool--GNU diff,好吧,其實我比較山,不知道上面這個這麼好用的工具。



跟git diff 的比較

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

Reference :


<>.chapter 6.git diff
《解決方案》

謝謝分享
《解決方案》

謝謝分享;P ;P
《解決方案》

cmp a.txt b.txt

[火星人 ] diff已經有476次圍觀

http://coctec.com/docs/service/show-post-1031.html