在git show commit中,/ dev / null有什么意义? [英] What's the significance of /dev/null in a git show commit?
问题描述
--- / dev / null
通过 git show commit
输出表示
这是一个新文件的添加,因此我假设它没有删除任何内容,但为什么引用 / dev / null $ c
$ $ $ $ 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屋!