A developer typically installs Git on their local machine. Then, they push their code to GitHub, which has a custom implementation of Git on its serve

How GitHub Reduced Repo Storage size by over 90%

submited by
Style Pass
2024-11-21 10:30:05

A developer typically installs Git on their local machine. Then, they push their code to GitHub, which has a custom implementation of Git on its servers.

1. BLOB -  Binary large object. This is what stores the contents of a file, not the filename, location, or any other metadata.

3. Commit - A snapshot of the files (blobs) and directories (trees) at a point in time. It also contains a parent commit, a hash of the previous commit.

A branch is just a named reference to a commit, like a label. The default branch is called main or master, and it points to the most recent commit.

If a new branch is created, it will also point to the most recent commit. But if a new commit is made on the new branch, that commit will not exist on main.

3. Removing sensitive data. Sensitive data usually exists in many commits. Removing the data from all those commits creates lots of new hashes. This makes those original commits unreachable.

It can be triggered manually using the git gc command. But it also happens automatically during operations like git commit, git rebase, and git merge.

Leave a Comment