Skip to main content

Command Palette

Search for a command to run...

Git & GitHub: The Best Habit I Started Early

Updated
β€’12 min readβ€’View as Markdown
Git & GitHub: The Best Habit I Started Early
K
Hi, I'm Komal, a BCA student passionate about technology and continuous learning. I'm currently building a strong foundation in frontend development while exploring AI Engineering, Machine Learning, and NLP. This blog is my digital journal where I share what I learn, the projects I build, the challenges I overcome, and the lessons I discover along the way. If you are a student starting your tech journey, I hope my experiences inspire and help you grow. Let's learn, build, and grow together.

When I first started learning web development, I was mostly focused on one thing:

β€œHow do I build a website?”

I was learning HTML, CSS, JavaScript, and slowly getting into React. My attention was always on writing code, making things look good, fixing errors, and adding new features.

But there was one thing I didn't take seriously in the beginning:

Git and GitHub.

And honestly, I wasn't using GitHub regularly.

I knew about GitHub. I had seen developers using it. I knew that projects were uploaded there.

But I didn't really understand why I should use it from the beginning.

That changed when I started building my first portfolio.


πŸ’₯ The Mistake That Made Me Understand Git

While building my first portfolio, I made a pretty big change in my code.

Actually...

I messed up a big part of it. 😭

I had changed things in my project and ended up creating a big mess in the code.

The worst part?

I couldn't restore the exact version of the code that was working before.

I tried to figure out what I had changed.

I went through the files.

I tried to undo things manually.

But I couldn't get the exact previous version back.

And that was the moment I realized:

β€œWait... what if I had saved the previous working version somewhere?”

That's when I properly started understanding why Git and GitHub exist.

It wasn't just some developer thing that I had to learn because everyone else was using it.

It was actually solving a problem I had just experienced myself.

I needed a way to keep track of my code and return to an earlier version when something went wrong.

That's when I decided:

I need to start using Git.


πŸ˜… But Learning Git Wasn't Easy for Me

Even after that experience, I didn't suddenly become a Git expert.

I had to learn it.

And honestly, it took me some time.

Commands like:

git init
git add .
git commit
git push

looked simple when I saw other developers using them.

But when I had to actually use them myself, I had questions.

What exactly am I committing?

Where are my files going?

What's the difference between Git and GitHub?

What happens if I make another mistake?

I slowly started learning the basic workflow instead of trying to understand everything at once.

And that's something I've realized about learning technology in general:

You don't always understand why a tool is useful until you actually face the problem that tool was designed to solve.

For me, Git was exactly like that.


🧠 So, What Exactly Are Git and GitHub?

Before using them properly, I wanted to understand what they actually do.

Git

Git is a version control system.

In simple words, Git helps you keep track of changes in your code.

Imagine you're working on a website.

You have one working version.

Then you add a new feature.

Then you change the design.

Then you experiment with something.

Then suddenly...

Something breaks.

Without version control, you might be stuck trying to remember what you changed.

Git allows you to create checkpoints of your project.

For example:

Added navbar
       ↓
Added hero section
       ↓
Added projects section
       ↓
Fixed responsive design
       ↓
Added contact section

Each meaningful commit becomes a point in your project's history.

GitHub

GitHub is where I can store and share my Git repositories online.

So the simple way I understand it now is:

Git = tracks changes in my project. GitHub = an online platform where I can store and share that project.

That simple distinction helped me understand everything much better.


πŸ”„ The Basic Workflow I Started Learning

The basic Git workflow I started with was:

1. Initialize Git

Inside my project folder:

git init

This tells Git:

β€œStart tracking this project.”

2. Check my changes

git status

This shows me which files have changed.

3. Add the changes

git add .

This prepares the changes for the next commit.

4. Create a commit

git commit -m "Added responsive navbar"

This creates a checkpoint.

5. Push to GitHub

git push

Now my committed changes can be pushed to my GitHub repository.

The workflow started looking like this:

Write Code
     ↓
Test
     ↓
Check Changes
     ↓
git add
     ↓
git commit
     ↓
git push
     ↓
GitHub

It looks simple now.

But learning this workflow was a process for me.


πŸ“Œ The Portfolio Problem Is Still a Lesson for Me

There's actually something funny about this story.

Even after realizing the importance of Git, I still haven't been able to completely fix that first portfolio.

The original problem taught me the lesson, but the project itself is still not exactly where I want it to be.

And honestly, that's okay.

Because that portfolio became more than just a website for me.

It became one of the projects that taught me how important version control is.

If I had been using Git properly from the beginning, I could have created a checkpoint before making that big change.

Then, if everything went wrong, I could have gone back to the previous working version.

But I didn't.

And I had to learn that lesson the hard way.


🧩 Git Became More Meaningful Once I Started Building Real Projects

When you're just following tutorials, Git can feel unnecessary.

You write some code.

It works.

You move to the next tutorial.

But when you start building your own projects, things become different.

You experiment.

You change things.

You add features.

You remove features.

You redesign sections.

You try new libraries.

And sometimes...

you break everything. πŸ˜‚

That's when having a history of your project becomes extremely useful.

Git doesn't prevent you from making mistakes.

But it gives you a much safer way to manage those mistakes.


πŸ“ Commits Are Like Small Checkpoints

One thing I started appreciating about Git is commits.

Instead of just saving files, I can create meaningful checkpoints.

For example:

Initial portfolio setup

Then:

Added hero section

Then:

Added projects section

Then:

Added responsive navbar

Then:

Fixed mobile layout

Looking at this later gives me a small history of how my project developed.

And as someone who is still learning, I think that's valuable.

Because sometimes we don't notice our own progress.

But when you look at an old project and compare it with what you're building now, you can actually see the difference.


🌐 GitHub Is Also Becoming Part of My Developer Journey

Initially, I thought GitHub was simply a place to upload code.

Now I see it differently.

It can become a record of what I'm learning and building.

My repositories can show:

  • Projects I've built

  • Technologies I've explored

  • Features I've implemented

  • Problems I've solved

  • Improvements I've made

Instead of only saying:

β€œI know HTML, CSS, JavaScript or React.”

I can actually show projects where I used them.

That's something I really like about GitHub.

It gives my learning a place where it can actually be seen.


πŸ“– And Then There Is README

Another thing I'm slowly learning is that a GitHub repository shouldn't just be a bunch of files.

A simple README can explain what the project is.

For example:

# My Portfolio

A personal portfolio website built while learning
frontend development.

## Technologies

- HTML
- CSS
- JavaScript

## Features

- About section
- Skills
- Projects
- Contact section
- Responsive design

It's a small thing, but it makes a project easier for someone else to understand.

And I'm learning that building a project isn't only about writing the code.

It's also about presenting and documenting what you built.


🚨 Git Also Taught Me Something About Mistakes

One thing I've slowly realized while learning programming is:

Making mistakes is normal.

Sometimes my code doesn't work.

Sometimes I break something.

Sometimes I make a change and immediately regret it.

πŸ˜‚

Git doesn't prevent me from making mistakes.

Instead, it can make experimenting feel safer.

I can make a change.

Try something new.

Test an idea.

And if I have created useful checkpoints, I have a much better chance of returning to an earlier version.

That mindset is important.

Because when you're learning, you should be comfortable experimenting.


πŸ‘©β€πŸ’» Why I Think Students Should Learn Git Early

If you're a student learning programming, you might think:

β€œI'll learn Git later when I become a professional developer.”

I used to think similarly.

But now I feel that Git is one of those skills that becomes easier when you start using it naturally.

You don't need to learn every advanced Git feature immediately.

Start with:

git init
git status
git add .
git commit
git push
git pull

Understand what each command does.

Then slowly learn:

git branch
git merge
git clone
git checkout

And eventually you'll encounter things like pull requests, merge conflicts, rebasing, and collaborative workflows.

There's no need to learn everything in one day.


🌱 I'm Still Not a Git Expert

I want to be honest about this too.

I'm still learning Git and GitHub.

I'm not someone who uses every advanced Git feature regularly.

I still have a lot to learn about:

  • Branches

  • Merge conflicts

  • Pull requests

  • Collaboration

  • Rebasing

  • Open-source workflows

Even now, I wouldn't say that I'm good at using GitHub properly.

I understand much more about why it is important, but I'm still learning how to use it properly and confidently.

I'm not using it in a perfect or consistent way yet.

Sometimes I still get confused about the workflow, commits, repositories, branches, and other things.

But I'm okay with that.

Because I'm learning it while actually building projects.

I don't want to pretend that I already know everything.


πŸ’» What I'm Doing Differently From Now On

From now on, whenever I start a new project, I want Git and GitHub to be part of my workflow from the beginning.

Instead of waiting until something goes wrong, I want to create proper checkpoints while building.

Something like:

Start Project
     ↓
Initialize Git
     ↓
Build a Feature
     ↓
Test It
     ↓
Commit the Changes
     ↓
Push to GitHub
     ↓
Continue Building

I know I still have a lot to learn.

But I think that's okay.

I'm not trying to master everything in one day.

I just want to become a little better with every project.

And hopefully, when I look back at my GitHub a few months from now, I'll be able to see that I've actually improved.


🎯 My Biggest Lesson

The biggest lesson wasn't actually a Git command.

It was this:

Don't wait until you need a tool to start learning why it matters.

I learned Git because I made a mistake.

I couldn't restore the exact code I wanted.

And that frustration made me understand something I hadn't understood from tutorials:

Your code is work worth protecting.

Even if you're a beginner.

Even if it's just a small project.

Even if you think:

β€œI'll upload it to GitHub later.”

Start early.

Create checkpoints.

Commit your work.

Because you never know when you'll make a change that you wish you could undo.


❀️ Final Thought

I started learning Git because I made a mistake while building my first portfolio.

I wasn't using GitHub regularly.

I wasn't familiar with it.

And when I messed up a big part of my code, I couldn't restore the exact working version.

Even today, I still haven't been able to completely fix that portfolio.

But that mistake taught me something important.

Git and GitHub aren't just tools that developers use because they're supposed to.

They can help protect the work you're putting your time into.

I'm still not very good at using GitHub.

I'm still learning.

I'm still making mistakes.

And I'm still trying to fix that first portfolio.

But from now on, I want to make Git and GitHub a proper part of my development journey.

Because I don't want my next big project to teach me the same lesson the hard way. πŸ˜…

Maybe that's what learning in public is really about.

Not saying:

β€œI know everything.”

But being able to say:

β€œI didn't know this before. I made a mistake. I learned why it matters. And now I'm going to do better.”

And that's exactly what Git & GitHub taught me.

One mistake. One messy portfolio. One important habit. πŸ’»πŸŒ±


πŸ’¬ What about you?

Have you ever made a change in your code and wished you could go back to the previous version?

Or are you just starting to learn Git and GitHub?

I'd love to know your experience. πŸ‘‡

Building My Tech Career

Part 10 of 10

Every developer has a beginning. This series is mine. Building My Tech Career is where I document my journey as a BCA student learning frontend development, exploring AI, building real-world projects, overcoming challenges, and growing one step at a time. If you're a student trying to find your place in tech, I hope these stories remind you that every expert was once a beginner. Let's learn, build, and grow together.

Start from the beginning

Why I Started Learning Frontend Development

A personal story about finding direction, embracing mistakes, and taking my first step toward becoming a Frontend Developer.

More from this blog