diff

在看<<version control with git >> 时偶然发现里面提到的一个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)

[root@HOSTNAME ~]# echo 'hello' >test
[root@HOSTNAME ~]# echo 'hello world' > test2
[root@HOSTNAME ~]# 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 :

<<version control with git >>.chapter 6.git diff
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值