🟡 TL;DR: Git, Branches & Aha Moments
I used Git for ages but never really got branching, merging, or rebasing — until I found LearnGitBranching.js.org. It turned Git into a game, and suddenly, I was like, “Ohhhh, that’s how it works!” From HEAD to cherry-pick, I can now move through Git like a pro.

Now I feel way more confident when working on projects, and the next step? Tackling merge conflicts like a champ and getting cozy with remote branches.

I’ve used Git before. You know—clone, add, commit, push, and forget. It worked… until it didn’t. Branching? Merging? Rebase? Those always felt like advanced sorcery reserved for Git wizards.

But then I stumbled upon LearnGitBranching.js.org — and wow. It turned Git into a game. A visual puzzle. A playground where I could finally see what was going on under the hood. So, I decided to revisit Git — this time, with branching goggles on.

Here’s a little tour of what I learned and loved. 🚀


🚀 Try It for Yourself!

If you’ve ever felt lost in the Git wilderness, take a moment to check out LearnGitBranching.js.org. It’s interactive, fun, and will transform Git from a daunting tool into an adventure! Whether you’re a newbie or just need a refresher, it’s a great way to get hands-on and see how branches, merges, and rebases truly work.

Plus, they have a sandbox where you can test your Git branching theories — it’s like having a personal Git playground to experiment without consequences. Trust me — it’s a game-changer.


🛠️ Git Commands I Now Use Like Spells

🧵 Branching Like a Boss

git branch <branch_name>        # Create a new branch
git checkout <branch_name>      # Switch to it
git checkout -b <branch_name>   # Create + switch in one go

It’s like opening a side quest — explore without messing up the main storyline!


🔄 Merge vs. Rebase (Now I Get It!)

git merge <branch_name>    # Blend in the changes
git rebase <branch_name>   # Move commits over
  • Merge is like inviting a friend into your timeline.
  • Rebase is like jumping into their timeline instead. Clean and linear, but mind the consequences!

🧠 HEAD, the Pointer with a Mind of Its Own

I used to think HEAD was just… a fancy word. Turns out it’s where you are, not necessarily where the branch points. You can move it around like a laser pointer.

HEAD^       # One commit up
HEAD~2      # Two commits back

You can stack them too. Super handy when navigating old commits like a Git archaeologist.


🎯 Move Things Around

git branch -f <branch> <commit>   # Force a branch to point elsewhere
git reset HEAD~1                 # Go back in time (softly or hard)
git revert HEAD                  # Undo without rewriting history

Perfect for those “oops” moments. And yes, I had a few.


🍒 Cherry-Pick Like a Pro

git cherry-pick <commit1> <commit2>

Grab the good stuff from another branch without taking the whole mess. Selective commit adoption, if you will.


🎛️ Rebase -i = Time Machine

git rebase -i main~4

Edit, squash, reword — it’s like editing your Git autobiography before publishing it. Feels oddly empowering.


🌐 Remote Branches: The Slightly Confusing Part

git fetch                  # Fetches changes, no merge
git pull                   # Fetch + merge
git push origin local:remote

Push logic unlocked: local:remote = push your local branch into the remote branch. (I always forget which side comes first 😅)

Also discovered:

git branch foo o/main       # Create from remote tracking
git branch -u o/main foo    # Set upstream

💭 Final Thoughts

LearnGitBranching.js.org made Git branching feel less like a beast and more like a tool — something I could actually play with, break, and fix without fear. Visual feedback makes all the difference when you’re trying to understand rather than just remember.

If you’ve used Git but avoided branching like I did — go give it a shot. You’ll come back feeling 10x more confident and ready to tackle collaborative chaos like a champ.