0
0
Gitdevops~5 mins

git cat-file to inspect objects - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the git cat-file command do?
It lets you look inside Git objects like commits, trees, blobs, and tags to see their content or type.
Click to reveal answer
beginner
How do you use git cat-file to show the type of an object?
Use git cat-file -t <object-hash> to display the object type (commit, tree, blob, or tag).
Click to reveal answer
beginner
How can you see the full content of a Git object with git cat-file?
Use git cat-file -p <object-hash> to pretty-print the content of the object.
Click to reveal answer
beginner
What types of Git objects can git cat-file inspect?
It can inspect commits, trees (folders), blobs (files), and tags.
Click to reveal answer
intermediate
Why would you use git cat-file instead of normal Git commands?
To see the raw data stored inside Git objects, which helps understand how Git stores your project history.
Click to reveal answer
Which option with git cat-file shows the object type?
A-t
B-p
C-s
D-e
What does git cat-file -p <hash> do?
APretty-prints the object content
BPrints the object size
CPrints the object type
DChecks if the object exists
Which Git object type represents a file's content?
Atree
Bblob
Ccommit
Dtag
If you want to see the size of a Git object, which git cat-file option do you use?
A-t
B-p
C-s
D-e
What is the main reason to inspect Git objects with git cat-file?
ATo delete objects
BTo merge branches
CTo create new commits
DTo see raw data inside Git
Explain how you would use git cat-file to find out what type of object a hash represents and then see its content.
Use -t to get type, then -p to see content.
You got /3 concepts.
    Describe the different Git object types and what git cat-file can show you about each.
    Think about files, folders, commits, and tags.
    You got /6 concepts.