Written on July 12th 2020 by Felix Halim

Inspired by the Missing Semester (https://missing.csail.mit.edu/)

What is Version Control System?

Version Control System or VCS for short is a tool that keeps track of changes in your folder and files. Some people often used the term Version Control and Source Control interchangeably. They indeed belong to the same theme, in fact, Source Control is a subset of Version Control that only handle Source code. This illustration perfectly explains where the territory of each term.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/61956f91-b5fc-4abb-90c3-54a796f08b59/Untitled.png

<aside> 💡 Read here for more explanation (It will redirect you to Quora.com)

</aside>

How does it work?

As explained above, VCS keeps track of changes in your folder and file. It maintains the history of the changes and in such a way, it is a very useful tool for a collaborative project. However, how does it do the job? It is actually very simple, just like how you "save" your game state or put a "checkpoint flag". It stores the changes as a series of snapshots and each snapshot is basically the current state on that point. You can think of the "checkpoint flag" as the snapshot and your "current score" as the saved state. Other than the actual changes, it also saves the metadata such as who created the snapshot (author), the message associated with the snapshot, the hash (unique string corresponding to the commit), etc.

What is the benefit for me? (as a developer)

You might want to first deduce it yourself by asking "Why should I save my game?". The answer is pretty straightforward, you can easily view the state of your code at any point in time (depending on your snapshot) because the series of snapshots is essentially a log of your project. Also, the branching capabilities allow collaboration of work because you can work in parallel with other developers.

What is Git?

Now that you understand the concept of VCS, you might have heard and wondered what the heck Git is. It is actually one example of VCS, probably one of the most popular version control tools and often considered as the de facto standard (cool jargon to say "everything that people use").

Git in Theory

Git used Directed Acyclic Graph (DAG) as the data structure of the snapshot history.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7258c883-24dd-4df0-8a56-db659e8cfdf6/Untitled.png

You might want to get yourself familiar with these terms to understand Git better:

  1. Commit ⇒ Snapshot
  2. Tree ⇒ Folder/Directory
  3. Blob ⇒ File

This illustration might help you better understand where those terms take place