TheNightCoder's Tech Diaries

Git Made Me Cry. Then I Learned These 5 Tricks

Git Made Me Cry. Then I Learned These 5 Tricks

"Git terrified me. The first time I saw a merge conflict, I thought I had broken everything.

I stared at the red lines, the <<<<<<< HEAD, and the >>>>>>> branch. I had no idea what to do.

Then I learned a few tricks. And suddenly, Git became my friend.

Here‘s what helped me."

eb5d6e063c917367450d1cd3ebaaa549d5edad21f8198d8f1fcf0738744796ce.jpg

1. Branch Often, Branch Early

When I first started, I worked directly on main. Big mistake.

Now I create a new branch for every feature, every fix, every experiment. It keeps my main branch clean and my stress levels low.

If I mess up, I just delete the branch and start over. No one gets hurt.

 

2. Write Commit Messages That Actually Help

I used to write things like 'fix' or 'update' or 'snjlp'.

Then I spent hours trying to understand what I did 3 months ago.

Now I write clear messages: 'Fix login bug for users without emails' or 'Add dark mode toggle'.

Your future self will thank you.

 

3. Learn a Few Commands (Not All of Them)

You don‘t need to master every Git command. I only use 10–15 regularly.

Here‘s my cheat sheet:

  • git status — what‘s going on
  • git add . — stage everything
  • git commit -m "message" — save your work
  • git push — send it to the world
  • git pull — get updates
  • git branch — see branches
  • git checkout -b new-branch — create and switch

That‘s 90% of what I do. The rest I Google.

156987e14621c06c507090d62dc2cb437a0996edb24b01ac44bf88b912de9917.jpg

4. Merge Conflicts Are Just Conversation

A merge conflict means Git doesn‘t know which changes to keep.

It‘s not a disaster. It‘s just a question: 'Which version do you want?'

I open the file, look for the <<<<<<< HEAD and >>>>>>>, and decide what to keep. Sometimes I keep both.

It takes 2 minutes. No panic needed.

3849e2ba2a23f4b4fb287e70ec9c3605e6d002599b6c1903ac24a4b343c90c56.jpg

5. Use Git GUI or VS Code Integration

You don‘t have to use the terminal. I love the terminal, but I also use VS Code‘s Git integration.

It shows changes visually, lets me stage files with a click, and resolves conflicts with a simple interface.

Find what works for you. Git doesn‘t care how you use it.

 

"Git is a tool, not a test of your worth. You don‘t need to know every command. You just need to know enough to get things done.

And when you mess up — because you will — just remember: there‘s always git reflog and a Google search away."

What About You?

"What‘s the scariest Git moment you‘ve had? Or do you have a favorite Git trick?

Share in the comments — I‘d love to learn something new!"

 

"If this article helped you feel less scared of Git, leave a tip or a like — it keeps me writing honest content for you."

 

#git, #programming, #coding, #softwareengineering, #studentlife, #versioncontrol, #beginners

How do you rate this article?

4



TheNightCoder's Tech Diaries
TheNightCoder's Tech Diaries

Practical guides on web development and life hacks for IT enthusiasts.

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.

Page not displaying correctly?