Skip to main content

Command Palette

Search for a command to run...

🌳 Git Explained Like You're 5

Published
β€’2 min read
S

Building AI systems and writing about how they actually work. Master of AI @ University of Technology Sydney. Previously B.Tech CS with focus on IoT. I believe the best way to learn is to explain. That's why I'm documenting tech concepts with simple analogies (@sreekarreddy.com). AWS Certified β€’ Azure AI Certified β€’ Neo4j Professional β€’ Google Data Analytics When not coding: exploring Sydney, working on side projects, and teaching tech to anyone who'll listen.

A time machine for your code

Day 26 of 149

πŸ‘‰ Full deep-dive with code examples


The Time Machine

Imagine writing an essay and being able to:

  • Save a snapshot every few minutes
  • Go back to any previous version
  • See exactly what changed between versions
  • Try something risky and undo if it breaks

Git is a time machine for your code!


How It Works

You make "commits" - snapshots of your code at a moment in time.

Commit 1: "Started project"
Commit 2: "Added login page"
Commit 3: "Fixed bug in login"
Commit 4: "Added dashboard" ← You are here

Messed up? Go back to Commit 3!


Key Commands

CommandWhat it does
git initStart tracking a project
git addStage files to save
git commitSave a snapshot
git logSee history
git checkoutGo back in time

Branches

Work on features without breaking the main code:

main:    ●——●——●——●
              \
feature:       ●——●——●

When feature is ready, merge it back!


In One Sentence

Git saves snapshots of your code so you can go back in time, experiment safely, and collaborate with others.


πŸ”— Enjoying these? Follow for daily ELI5 explanations!

Making complex tech concepts simple, one day at a time.

More from this blog

esreekarreddy

132 posts