DEV Community

Cover image for Git Wasn't the Hard Part. Explaining It Was.
Dhruv Mevada
Dhruv Mevada

Posted on

Git Wasn't the Hard Part. Explaining It Was.

Git Wasn't the Hard Part. Explaining It Was.

I thought teaching Git to my friend would take about 30 minutes.

You know... install Git, create a repository, make a commit, push it to GitHub, and we're done.

Three hours later, we were debating whether the .git folder was a database, a hidden backup, or some kind of developer black magic.

That's when I realized something.

Git isn't hard because of the commands. It's hard because of the way it makes you think.


"If GitHub stores everything, why do I need Git?"

That was the very first question.

Honestly... it's a fair question.

When you've never used version control before, Git and GitHub sound like they're the same thing.

So instead of giving the textbook explanation, I used an analogy.

Your project folder is your notebook.

Git is the history of everything you write in that notebook.

GitHub is Google Drive where you upload that notebook so others can access it.

The expression on my friend's face immediately changed.

"Okay... that actually makes sense."

That was the first small victory.


The Magic of git init

We opened a terminal and typed:

git init
Enter fullscreen mode Exit fullscreen mode

My friend looked at me and asked,

"Did anything even happen?"

I smiled.

"Yes."

"But... nothing changed."

"Exactly."

One hidden folder appeared.

That's all.

Yet that tiny hidden .git folder is what transforms an ordinary project into a Git repository.

It's funny how one invisible folder powers the workflow of millions of developers.


The First Commit

We created a simple README file.

git add .
git commit -m "Initial commit"
Enter fullscreen mode Exit fullscreen mode

Another question arrived.

"So... is it online now?"

"No."

"Then where is it?"

"It's safely stored on your own computer."

That was another lightbulb moment.

A lot of beginners assume every Git command uploads their code somewhere.

Understanding that Git works locally first makes everything else much easier.


Connecting to GitHub

We created a repository on GitHub.

Then came the commands:

git remote add origin <repository-url>
git branch -M main
git push -u origin main
Enter fullscreen mode Exit fullscreen mode

A few seconds later, we refreshed GitHub.

The repository appeared.

My friend literally smiled and said,

"Wait... that's my code?"

Yes.

For experienced developers, pushing code to GitHub feels routine.

For someone doing it for the first time, it feels like launching a rocket.


The Questions That Made Me Think

Some of my favorite questions from that session were:

  • "Why do we need Git if we already save files?"
  • "What's inside the .git folder?"
  • "Why isn't my commit visible on GitHub?"
  • "Why do we need both Git and GitHub?"
  • "Why do people use branches instead of just making another folder?"

They were simple questions.

But answering them forced me to rethink concepts I'd been using automatically for months.


Teaching Made Me a Better Developer

People often say,

"The best way to learn something is to teach it."

I didn't fully believe that until this session.

When you're using Git every day, commands become muscle memory.

You stop thinking about why they exist.

Teaching someone else made me slow down and understand the reasoning behind every step.

It reminded me that beginners aren't confused because Git is impossible.

They're confused because they're learning an entirely new way of thinking about code.


Final Thoughts

By the end of the session, my friend had:

  • Installed Git
  • Created a local repository
  • Made the first commit
  • Connected the project to GitHub
  • Pushed code successfully

More importantly, they understood why each step existed.

And I walked away with something too.

Not better Git commands.

A better understanding of Git itself.

Sometimes the biggest lessons don't come from building software.

They come from helping someone else build their confidence.


Have you ever taught Git to someone?

What was the funniest question they asked? or, if you're just starting out, what confused you the most?

I'd love to hear your stories in the comments.

Top comments (0)