Git Flashcards
What is delta storage model of source code control?
First commit stores all the files, and the later commits stores the diffs from the original version and subsequent versions
What is DAG storage model of source code control?
It stores the snapshot of each file with each commit
What is the advantage of delta storage?
It is space efficient
How does the source code control taxonomy look like?
How to override the .git directory?
By using the GIT_DIR environment variable
What are the basic contents of git directory?
config file, hooks, index, object database, references
How is new content stored in the object database
type + ‘ ‘ + content.size + ‘\0’ + content
Which hash algorithm is used by git?
SHA1
How is content stored on the disk?
It is stored in a compressed format with the file name being the first few letters of the hash
What does git gc achieve?
It finds all the objects that point to the same file with minor differences, packs the changes in a .pack file and also creates a .idx file that points to different places in the .pack file. It also deletes the compressed objects after this activity
What is “loose format” vs “packed format”?
Objects stored in compressed form in directories are loose format, while objects stored in .pack file is packed format
What are 4 types of git objects?
blob, tree, commit, tag
What is a blob?
Every file is converted to a blob in the .git directory
How is a file converted to blob?
Take the file, add the header, calculate the checksum, compress and store the file
What is a tree object?
Every directory is a tree object