Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view git objects and index without using git

Using the OS X terminal,

How an you view the contents of these files as plain text?

like image 406
Corey Floyd Avatar asked Oct 07 '09 15:10

Corey Floyd


People also ask

What is the Git command used to show various types of objects?

git-show is a command line utility that is used to view expanded details on Git objects such as blobs, trees, tags, and commits. git-show has specific behavior per object type.

Does Git use zlib?

git uses a library called zlib for compressing the objects.

Where is the object database located in a Git repository?

Within a repository, Git maintains two primary data structures, the object store and the index. All of this repository data is stored at the root of your working directory in a hidden subdirectory named . git.

How are Git objects stored?

Technically, Git stores content in a manner similar to a UNIX filesystem, but a bit simplified. All the content is stored as tree and blob objects, with trees corresponding to UNIX directory entries and blobs corresponding more or less to inodes or file contents.

What are the 3 main types of objects in a Git database?

There are 3 main types of objects that git stores: Blob: This object as we have seen above stores the original content. Tree: This object is used to store directories present in our project. Commit: This object is created whenever a commit is made and abstracts all the information for that particular commit.


1 Answers

alias deflate="perl -MCompress::Zlib -e 'undef $/; print uncompress(<>)'"

deflate .git/objects/4b/3083256dedabd68e839d7717aa785424119990 | sha1sum
4b3083256dedabd68e839d7717aa785424119990  -
like image 85
bwtaylor Avatar answered Oct 12 '22 10:10

bwtaylor