git 在特定文件上显示 return 'fatal: bad object'
git show on a sepecific file return 'fatal: bad object'
我正在使用 git show 来检索在 Github 中托管的 elasticsearch 特定修订版的文件内容。这是我的 git 命令,我 运行 在项目的根目录下:
git show 63cbc8439357f496ce630c2eb35b2cf02342fa4b~1:rest-spec
但是,我收到以下错误:
fatal: bad object 63cbc8439357f496ce630c2eb35b2cf02342fa4b~1:rest-spec
rest-spec在版本63cbc8439357f496ce630c2eb35b2cf02342fa4b~1中已经存在,下个版本会改。您可以在 Github 中看到下一个修订版 here 的更改,我使用以下命令在本地克隆中验证了它:
git show 63cbc8439357f496ce630c2eb35b2cf02342fa4b
这是上面 git 显示的输出(我只包括 rest-spec 的变化):
diff --git a/rest-spec b/rest-spec
deleted file mode 160000
index b3ab724..0000000
--- a/rest-spec
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit b3ab72486fae1b5c5a5397356a3e113bf72eb6d5
非常感谢您的帮助!
那是因为 rest-spec
是 elasticsearch repository and, thus, is not an object belonging to (directly stored in) that repository. Look at the tree of the 63cbc8439357f496ce630c2eb35b2cf02342fa4b~1 revision to make sure that rest-spec
is different from other objects. It is recorded in the elasticsearch
repository through the .gitmodules
file, and the contents of the referenced repository elasticsearch-rest-api-spec are made available as a subdirectory in the working tree of the superproject (i.e. the elasticsearch
repository) via the git submodule
commands. For more details see the Submodules chapter in the Git Book and the documentation of the git submodule
command 的子模块。
我正在使用 git show 来检索在 Github 中托管的 elasticsearch 特定修订版的文件内容。这是我的 git 命令,我 运行 在项目的根目录下:
git show 63cbc8439357f496ce630c2eb35b2cf02342fa4b~1:rest-spec
但是,我收到以下错误:
fatal: bad object 63cbc8439357f496ce630c2eb35b2cf02342fa4b~1:rest-spec
rest-spec在版本63cbc8439357f496ce630c2eb35b2cf02342fa4b~1中已经存在,下个版本会改。您可以在 Github 中看到下一个修订版 here 的更改,我使用以下命令在本地克隆中验证了它:
git show 63cbc8439357f496ce630c2eb35b2cf02342fa4b
这是上面 git 显示的输出(我只包括 rest-spec 的变化):
diff --git a/rest-spec b/rest-spec
deleted file mode 160000
index b3ab724..0000000
--- a/rest-spec
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit b3ab72486fae1b5c5a5397356a3e113bf72eb6d5
非常感谢您的帮助!
那是因为 rest-spec
是 elasticsearch repository and, thus, is not an object belonging to (directly stored in) that repository. Look at the tree of the 63cbc8439357f496ce630c2eb35b2cf02342fa4b~1 revision to make sure that rest-spec
is different from other objects. It is recorded in the elasticsearch
repository through the .gitmodules
file, and the contents of the referenced repository elasticsearch-rest-api-spec are made available as a subdirectory in the working tree of the superproject (i.e. the elasticsearch
repository) via the git submodule
commands. For more details see the Submodules chapter in the Git Book and the documentation of the git submodule
command 的子模块。