简体   繁体   中英

how can I diagnose git cat-file claiming objects are missing?

I want to see the contents of a blob in git, but can't. What can I check?

$ ls -l .git/objects/25/8f90d906f3c9c9b802042d33eb13d406d60f8b
-r--r--r--  1 shauncutts  staff  2351 Jan  7 17:32 .git/objects/25/8f90d906f3c9c9b802042d33eb13d406d60f8b
$ echo .git/objects/25/8f90d906f3c9c9b802042d33eb13d406d60f8b | git cat-file --batch
.git/objects/25/8f90d906f3c9c9b802042d33eb13d406d60f8b missing
$ git --version
git version 2.17.2 (Apple Git-113)

It also happens with home-brew git:

$ echo .git/objects/25/8f90d906f3c9c9b802042d33eb13d406d60f8b | /usr/local/bin/git cat-file --batch
.git/objects/25/8f90d906f3c9c9b802042d33eb13d406d60f8b missing
$ /usr/local/bin/git --version
git version 2.21.0

对象名称是哈希码,而不是有时用于保存其内容的路径名。

git cat-file --batch <<<258f90d906f3c9c9b802042d33eb13d406d60f8b

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM