Behind the scenes of GIT

I have joined and started learning Software development with ChaiCode Web dev Cohort 2026 and very excited😊
Search for a command to run...

I have joined and started learning Software development with ChaiCode Web dev Cohort 2026 and very excited😊
No comments yet. Be the first to comment.
this is series for git and github and following questions to be answered in this series: why git is used ?History about git why it is more popular? commands used in daily work?how to used in projects ?how to do collaboration
What is Github ? it is hosted platform of git repo . there are many such platforms like Bitbucket, Gitlab etc. Uses: - to push code in cloud. - it enables collaboration with other developers. - Open Source Projects - we can access code from anywhere ...
Lets differentiate and understand about global and globalThis used in nodejs or any JS ecosystem like whether it will be in browser , nodejs, deno, web workers etc. What is global ? global means glo
Lets learn about path module of nodejs path module helps to get files and directory and works with it and write code for cross platform code . like getting files from any operating system like macos,
The virtual DOM is a lightweight copy of the real DOM that allows React to manage changes more efficiently by minimizing the direct manipulation required on the real DOM. This process significantly en
About template literal , use case and reasons of bringing it and benefits

why do it need to flatten array and various ways of flatten the array

it is folder which git create when we initialize any project to track by th command `git init`. git use this folder to store all the commits, tags, blobs, tree , heads, branch any many other things to keep track our changes in files.
there are files and directory like
HEAD
refs/
objects/
hooks/
info/
logs/
index
config
it is file for customization of repo like color, alias , remote etc.
```
# color customization
[user]
name=some name
email=some email
[color]
ui=true
[color "branch"]
local= cyan bold
current= magenta
[color "diff"]
old=add some color
new=add another color
```
it is directory that store pointer of heads , tags, remotes .. etc.inside heads/ there are reference for latest commit-hash for branch like master, bugFix, darkMode, many other branches.
The objects directory contains all the repo files. This is where Git stores the backups of files, the commits in a repo, and more. The files are all compressed and encrypted, so they won't look like much
- commit
- blobs
- tree
- annotated tags
the function which map the inputs of arbitrary size into some fixed size output.
Note: git use SHA-1 algorithm for hashing function which gives 40 characters hexadecimal number which is commit-hash, blobs-hash etc.
Git is a key-value data store. We can insert any kind of content into a Git repository, and Git will hand us back a unique key we can later use to retrieve that content. These keys that we get back are SHA-1 checksums.

Git blobs (binary large object) are the object type Git uses to store the contents of files in a given repository. Blobs don't even include the filenames of each file or any other data. They just store the contents of a file.
Trees are Git objects used to store the contents of a directory. Each tree contains pointers that can refer to blobs and to other trees. Each entry in a tree contains the SHA-1 hash of a blob or tree, as well as the mode, type, and filename.
viewing trees : git cat-file -p master^{tree}
git cat-file -t <object-hash> : tell about type of object like commit, blob, tree

Commit objects combine a tree object along with information about the context that led to the current tree. Commits store a reference to parent commit(s), the author, the committer, and of course the commit message!.
every commit got reference to previous commit in parent:<commit-hash>
we can see by using `git cat-file -p <commit-hash>`

NOTE : everything is stored as hashed in objects directory so that git can retrieve data by the hashed key which is output of SHA-1 hashing function
