Table of Content

Miscellaneous Commands

# View usage of a command
git help <command> 			
 
# View the status of files in a repo
git status
 
# View who was responsible for an change
git blame <filename>
 
# View the changes that occurred in the commit
git show <commit-id>

Head (Reference to the snapshot that we are currently looking)

Internal Structure

Git Repo consist of three types of objects: Blobs, Trees and Commits
Blobs: Object IDs (OID) that contain the file content
Tress: OID that points to other blobs or trees. It is recursive structure. It includes the modes and type of the object
Commit: It is an OID that contains the commit related information

# Returns OID/ Hash of Object
git rev-parse HEAD:file-name
 
# Returns content of the object
git cat-file -p OID
git cat-file -p HEAD:file-name
 
# Returns the SHA Hash of a object
git hash-object -w file-name

These details are stored inside the object directory
The Git database is a very complex key value store

A Hacker’s Guide to Git | Wildly Inaccurate

Version Control (Git) · Missing Semester