Skip to main content

Command Palette

Search for a command to run...

Git for Beginners or How I Stopped Naming Files final_final_real_v3.cpp

Updated
3 min readView as Markdown

😭 The Dark Ages: Life Before Git

Have you ever had files similar to:

project.cpp
project_final.cpp
project_final_real.cpp
project_final_real_pls.cpp

Congratulations Version Control Trauma is something you have experienced.

Right now:

  • Your mind is perplexed.

  • Your laptop is passing judgment on you.

  • You and your code have a poisonous relationship.

Git enters the picture like this:

"Calm down, buddy; I've got this."

🤔 Git: What Is It?

Git is essentially:

Google Drive, Time Machine, and Group Chat—but only for your code.

It recalls:

  • What you altered

  • When you altered

  • Who made a mistake?

  • And how to repair the harm 😌

Therefore, rather than saying:

"Yesterday, my code worked, bro 😭."

You may say:

"Don't worry, I'll simply roll back."

Energy of the main character.

😎 Why Developers Use Git (Short Answer: Because Life is Pain)

Git is used by developers because

  • Human make mistakes

  • Laptops crash

  • Colleagues remove files

  • Code breaks at random

  • Life is painful

Git functions similarly to the Save Game button in video games. 🎮

One incorrect move? Checkpoint reload. No psychological harm.

🧠 Git Terms

📁 Repository (Repo)

  • The home of your project Where all the code coexists peacefully (until bugs attack)

Commit

  • A place to save

  • Like: “This version works, don’t touch it.”

🌿 Branch

  • A different universe

  • The main narrative versus your dangerous experiments

🎯 Head

  • Your present position

  • Where you are right now in the story

🧺 Stage Area

  • Your shopping cart

  • Prior to actually checking out (commit)

Git Commands

Git init

  • "All right, Git, begin viewing my project 👀."

Git status

  • "Git, what’s going on?"

Git add.

  • "Add everything to the cart 🛒"

Git commit -m "message"

  • "Save my progress 💾"

Git log

  • "Show me my past mistakes"

🏗️ The Actual Development Process

The lives of all developers:

Every developer’s life:

  1. Write code2.

  2. Break code

  3. Panic

  4. Fix code

  5. Use Git to save

  6. Feel amazing 😎

Command version:

git init  
git add .  
git commit -m "It finally works"

That’s it.
No PhD required.

📊 How Git Actually Works

Your code moves like this:

Your Brain → Code → Staging → Git → Peace

Git is just there to make sure you don’t cry too much.

🤡 Without Git vs With Git

Without Git:

  • "Who made the changes to this file?"

  • "Why doesn't anything work?"

  • “I hate my life.”

With Git:

  • "Yes, this was caused by commit 3."

  • "Rollback."

  • Peace has been restored.

🧠 Concluding Remarks (Before You Scroll Away)

Git does not increase your intelligence. It simply allows you to undo your mistakes.

Additionally, in programming... That is essentially a superpower 🦸‍♂️.

More from this blog

G

Git for Beginners

13 posts