DEV Community

Cover image for From Chaos to Commits: A Beginner's Git Journey
Aküm Imchen
Aküm Imchen

Posted on

From Chaos to Commits: A Beginner's Git Journey

Imagine three friends: Riya, Sam, and Alex are working on a school coding project. They decide to use Git and GitHub to manage their work without stepping on each other’s toes. Here’s how their journey teaches us Git, one command at a time:

🧠 What are Git and GitHub?

🛠️ Git = A Smart Notebook

Git lets the friends save versions of their work, try new ideas, and go back in time when needed.

Think of Git as a super-organized notebook that remembers every change you make.
or in technical terms ,Think of Git as your personal version control assistant who keeps track of every change and helps you avoid chaos.

🌐 GitHub = An Online Locker Room

GitHub stores their Git projects online — so everyone can collaborate, review, and contribute.

🧑‍💻 GitHub is like a shared digital locker room where everyone syncs their notebooks.

So with a simple analogy above lets dig in deep on how the commands work and what is their purpose...

🎒 Step 1: Starting the Project
🧑‍🏫 Alex says: "Let’s start tracking our project!"

gitinit
This command sets up Git in the folder — like creating a special notebook for the project.

📥 Step 2: Getting the Project

👨‍💻 Sam clones the project from GitHub:

cloning
it's like photocopying Riya’s notebook so he can work too.

👀 Step 3: Checking What’s Going On

👩‍💻 Riya wants to know what’s changed:

status
It’s like flipping through the notebook to see which pages were edited.

📝 Step 4: Saving the Work
Sam finishes his part and says:

saving the work
✅ git add . is like selecting all your work to turn in.
📝 git commit -m is like writing a note saying what you did.

🚀 Step 5: Pushing to GitHub
Alex is ready to upload everything:

upload everything
It’s like submitting your homework to the shared online folder.

🔄 Step 6: Getting Updates
Riya wants the latest updates from the team:

pull(status)
She’s downloading their homework so she’s up to date.

🌿 Step 7: Trying New Ideas Safely
Sam wants to experiment without affecting the main project:

temporary
it’s like taking a photocopy of the notebook to try new things.

🔀 Step 8: Merging Work
Riya likes Sam’s changes and wants to include them:

merging
It’s like pasting Sam’s notes into the main notebook.

⚠️ Step 9: Oops! They Edited the Same Line
Now Git says there’s a conflict!
They work it out manually, then:

manually

It’s like fixing the overlapping notes and resubmitting.

💼 Step 10: Temporarily Saving Work
Alex needs to switch tasks but doesn’t want to lose progress:
edits
He puts his work in a temporary locker.
Later he brings it back:

temporary

🧹 Bonus: Cleaning Up
Riya made a mistake in the last commit:

edits
She undoes the last commit but keeps her files safe.

🔚 Conclusion:
Git and GitHub are essential tools for managing code, tracking changes, and collaborating smoothly. Once you understand the basics, they make development faster, safer, and more organized.

Start small, practice often — and you'll Git it in no time! ✅

Written by @benimchen | Mentored and guided by @devsyncin

Top comments (0)