Skip to main content

I Have Multiple Changes But Only Want to Commit the Port Update—My Git Partial Staging Journey

· 13 min read
Mahmut Salman
Software Developer

I changed my dev server port from 5173 to 5174 across three files, but I also had other unrelated changes in those same files! 😰 I only wanted to commit the port changes. My mentor walked me through Git's partial staging features: git add -p, git stash, interactive staging, and patch mode. After some trial and error (and learning what NOT to do), I successfully committed only the port changes while keeping my other work-in-progress safe. This is professional Git workflow! 🎯

Wait, I Only See h-48 for Height—Where's the Width? Understanding How CSS Grid Automatically Sizes Cards

· 14 min read
Mahmut Salman
Software Developer

I built my responsive grid with grid-cols-1 sm:grid-cols-2 md:grid-cols-3, and I see h-48 controlling the image height, but where's the width? 🤔 There's no w-48 or w-64 on my cards! How do they know how wide to be? My mentor dropped a knowledge bomb: "The grid controls width automatically—you don't set it!" This blew my mind. The grid is the boss, and cards just obey. Understanding this changed how I think about responsive layouts! 📐✨

I Copied [responsive-columns] Literally and It Didn't Work! Understanding Placeholders vs Real Code

· 13 min read
Mahmut Salman
Software Developer

I was following a tutorial and copied this code: <div class="grid [responsive-columns] gap-6"> and NOTHING HAPPENED! 😱 My grid looked broken and I couldn't figure out why. My mentor pointed out the issue immediately: I copied [responsive-columns] literally as a class name! It was a placeholder meant to be replaced with actual Tailwind classes. This embarrassing moment taught me the crucial difference between documentation placeholders and real code. Never again! 🔥

How Does This Badge Work? Understanding CSS Class Order and the relative-absolute Pattern

· 13 min read
Mahmut Salman
Software Developer

I copied the classes for a notification badge and it worked perfectly, but I had no idea what was happening! 🤔 The classes were all jumbled: absolute -top-2 -right-2 bg-red-500 text-white... My mentor reorganized them in logical order, and suddenly everything clicked. Then I made a brilliant connection: relative + absolute is like max-w + mx-auto—they're paired concepts that work together! This conversation taught me to see the patterns behind CSS.

Wait, What's [&_button] in Tailwind? Understanding &, >, and _ Selectors for Nested Elements

· 12 min read
Mahmut Salman
Software Developer

I saw this weird Tailwind class: [&_button]:rounded-lg and had no idea what the & and _ meant! 🤔 It looked like CSS, but also different? My mentor explained these are arbitrary variant selectors—Tailwind's way of targeting child elements. The _ (underscore) represents a space in CSS selectors, and it's the key to styling deeply nested children. This conversation unlocked a whole new level of Tailwind power!

How Do I Know My Grid Actually Works? Testing Responsive Layouts with Colorful Placeholders

· 14 min read
Mahmut Salman
Software Developer

I just set up my responsive grid container with grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4, but how do I know it actually works? 🤔 It's just an empty container! My mentor showed me a brilliant testing strategy: add colorful placeholder boxes to VISUALIZE the grid! This changed everything. Now I can resize my browser and watch the magic happen in real-time. No more guessing—I can SEE exactly what my users will experience! 🎨✨

Fast-Forward Merge vs Rebase: Which One Should You Use? 🤔

· 14 min read
Mahmut Salman
Software Developer

The Confusion 😕

Frontend Dev: "I just finished working on my frontend branch and want to merge it into main. Someone told me to use rebase, but when I ran git rebase main, it said 'Current branch frontend is up to date.' What does that mean? Should I use merge instead?"

Git Mentor: "Ah, this is one of the most confusing topics in Git! Let me show you the difference between fast-forward merge and rebase, and when to use each one. Your 'up to date' message actually tells us something important!"

Git Worktree Mystery: Why Isn't My Postman Folder Ignored? 🔍

· 11 min read
Mahmut Salman
Software Developer

The Confusion 😕

Backend Dev: "I just created a Postman collection in my backend worktree, and now Git is showing the entire postman/ folder as untracked files! I thought API testing folders were supposed to be gitignored automatically?"

DevOps Mentor: "Ah, you've discovered one of the subtle quirks of Git worktrees! Even though worktrees share the same repository, they each need proper .gitignore configuration. Let me show you what's happening!"

Why Do I Need Force Push After Rebase? 🚀

· 15 min read
Mahmut Salman
Software Developer

The Confusion 😕

Backend Dev: "I just successfully rebased my backend branch with 18 commits onto main! But when I try to push, Git says I need to force push. Why can't I just do a regular push? What happened to my commits?"

Git Mentor: "Ah! You've encountered one of Git's most important safety mechanisms. Let me show you exactly what happened during your rebase and why you now need force push!"

Wait, My Main Branch Doesn't Have My Changes? 🤯 Understanding Rebase vs Merge

· 15 min read
Mahmut Salman
Software Developer

The Confusion 😕

Backend Dev: "I just successfully rebased my backend branch onto main with 18 commits. So now my main branch has all my backend changes, right?"

Git Mentor: "Actually... no! Your backend branch is updated, but main still doesn't have your changes!"

Backend Dev: "WHAT?! But I thought rebase puts my commits on top of main? Isn't that the same thing?"

Git Mentor: "Ah! This is one of the most common misunderstandings about Git! Let me show you exactly what happened and why main still doesn't have your changes!"