What is Git?

Git is a software that is used mainly by those who build software. A tool for building tools created by toolmakers.

It records the changes to a set of files to provide a comprehensive history, and has commands to smoothly merge alternate versions of the files.

It’s a work of genius and has been highly influential in the acceleration of software development over the past 20 years. I reckon its core concepts are interesting to a wider audience beyond tech.

Git is a clever tool for coding projects. It’s like having a well-organized time-traveling notebook. Each key change is saved as a “commit,” a snapshot of the project at that time.

Now, imagine making a complex structure with LEGOs. Git takes it up a notch with “branches,” creating a separate space to experiment. It’s like having a different LEGO world where you can try out wild ideas without affecting your main creation. If the experiment succeeds, Git give you various commands to seamlessly merge it back into your original masterpiece. This is a fundamental requirement when collaborating with others who are likely distributed geographically and not working at the same exact time.

In essence, Git helps ensure coding is organised and efficient. It provides freedom to explore and experiment. We can always revert to a stable point if things get shaky.

Sharon Cichelli’s explanation from Oct 2017 is a wonderful read.

Its central point to visualise what each commit (snapshot) represents, is her analogy of people waiting in a queue: Think of commits like people waiting in a shop, each pointing to the person he or she follows.

.
diagram via Sharon Cichelli

If you already know Git, then you might have found frustration followed by satisfaction when you:

  • find yourself in a detached HEAD state
  • perform an interactive rebase
  • “clean” a repo to remove large or sensitive files
  • hone your set of git aliases

From 2013, Micheal G Schwern presents Git For Ages 4 And Up using tinker toys. I found it particularly helpful to visualise the labels of branches and what HEAD means.

And you might find this parody both apt.