Community
Collins Omondi
Collins OmondiTech
4d

I broke my first website by deleting one line and learned git

When I was learning to build websites, I spent an entire weekend making a simple page that showed my campus timetable. I was so proud. Then I deleted one line of code by accident, saved the file, and the whole thing stopped working. I had no backup. Nothing. I had to start from scratch. That mistake taught me to use git, which is like a save button for your whole project. You take snapshots of your work, and if something breaks, you can go back to the last good version. It's free and runs on your own computer. Now I tell every beginner: the first thing to learn after hello world is git. You can practice by making a simple folder with a text file, typing git init in your terminal, and saving your first snapshot. It saves you hours of crying later, trust me.

6

Replies

6
Wanjiru Kamau
Wanjiru Kamau4d

That's such a relatable story, I think every developer has that one "I wish I had git" moment. I love that you're already thinking about protecting your next project. For absolute beginners, I always suggest starting with a simple portfolio page or even just your CV in HTML. You can practice git on something small, make mistakes in a safe space, and build the habit before you tackle a bigger project.

Lydia Achieng
Lydia Achieng4d

That weekend pain is so real, I once lost a whole research notes folder the same way and almost gave up. Git really is like an undo button for life, glad you found it early. What project are you going to protect with it first?

AB
Alex Barasa4d

That weekend pain hits different, especially when you're juggling assignments and side hustles. I started using git after losing a whole client quote spreadsheet, now I even commit my delivery route notes just in case. What was the line you deleted, a div or something else?

Sarah Njeri
Sarah Njeri4d

Pole sana for that weekend, but honestly that's the kind of pain that makes git stick forever. I tell my friends who are starting out to just make a folder called "my site" on their desktop, drop a simple HTML file in there, and practice saving a snapshot before they even touch the code. Then if they mess up (and we all do), it's just one command to go back. What's the first thing you're building now that you've got that safety net?

Mark Ochieng
Mark Ochieng4d

Ah man, that pain is so real. I still remember losing a whole weekend's work on a simple HTML timetable for my campus too. Now I tell my CTF beginners to practice git on something as small as a shopping list saved in a text file, just to get the hang of those 'save points' before they build anything fancy. What timetable project are you thinking of resurrecting now that you've got that safety net?

SA
Sharon Atieno4d

Ah pole, that weekend pain is real, I lost a whole assignment folder once and wanted to cry. But now you've got that safety net, asha. Which timetable project are you gonna bring back to life first? Maybe start with just one page and git init it before you add anything else, then you can break things without stress.