在git show commit中,/ dev / null有什么意义? [英] What's the significance of /dev/null in a git show commit?

查看:215
本文介绍了在git show commit中,/ dev / null有什么意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

--- / dev / null 通过 git show commit 输出表示



这是一个新文件的添加,因此我假设它没有删除任何内容,但为什么引用 / dev / null
$ $ $ $ g $ show a395a
commit a395a7bb4abcc606022ac14a07794b2d3c18bd5b
作者:David Banks< BanksySan @ googlemail.com>
日期:Sun Apr 12 17:41:08 2015 +0100

我的第一次提交。

diff --git a / test.txt b / test.txt
新文件模式100644
索引0000000..e965047
--- / dev / null
+++ b / test.txt
@@ -0,0 +1 @@
+ Hello


解决方案

这意味着,因为test.txt是一个新文件,所以在显示的diff中将其与nothing进行比较。 file/ dev / null。


What does the --- /dev/null signify in by git show commit output?

This is an addition of a new file, so I assume it's saying that nothing was removed, but why the reference to /dev/null?

$ git show a395a
commit a395a7bb4abcc606022ac14a07794b2d3c18bd5b
Author: David Banks <BanksySan@googlemail.com>
Date:   Sun Apr 12 17:41:08 2015 +0100

    My first commit.

diff --git a/test.txt b/test.txt
new file mode 100644
index 0000000..e965047
--- /dev/null
+++ b/test.txt
@@ -0,0 +1 @@
+Hello

解决方案

It means that because test.txt is a new file, in the diff shown, it was compared to "nothing"; the "file" /dev/null.

这篇关于在git show commit中,/ dev / null有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆