Introduction: The Day Everything Went Wrong at PixelForge Studios

Every developer remembers the day Git finally “clicked.”
For me, it happened at a small software company called PixelForge Studios, where a team of four junior developers attempted to collaborate on a feature and accidentally turned the main branch into something that resembled a tornado had hit it.
What caused the chaos?
A misunderstanding of Git merge, Git rebase, and Git cherry-pick.
Let me paint the scene:
- Sarah merged her work into the main, but forgot to pull first, which resulted in conflicts in the codebase.
- James rebased on main, but panicked when his commit history “changed itself.”
- Chidi cherry-picked five commits… into the wrong branch.
- And Mike (our intern hero) tried to fix everything with a git push --force.
That day, our lead engineer sat us down and said:
““Git isn't just a tool; it’s teamwork logic. Understand it, and your projects become peaceful. Ignore it, and your branches become war zones.””
This blog post is that peace treaty.
So let’s break down Git merge, Git rebase, and Git cherry-pick in the simplest, most fun, beginner-friendly way possible.
Understanding Git Branches (The “Team Workflow” Analogy)
Before we jump into the commands, imagine this:
You’re building a new app at work. The main branch is like the official company document, the polished version. Every time you want to make a feature, you create a branch, which is like making a photocopy of that document so you can edit safely.
- main → official company document
- feature-login → your photocopy where you're editing
- feature-ui → someone else’s photocopy
Now the question becomes:
When you're done with your branch, how do you bring your changes back into the main document?
That’s where Merge, Rebase, and Cherry-pick come in.
Git Merge: "Let’s combine everything safely, even if it gets a little messy."

Concept (Beginner Friendly)
Merge keeps the history of both branches exactly as they are, and then creates a final commit that joins them together.
Picture two teammates bringing their copies of the document to the office and stapling them together. Nothing is rewritten, nothing rearranged. It’s honest, simple teamwork.
When to Use Git Merge
- You want to preserve the full history
- You work on a team and want to avoid confusion
- You don’t mind a few “merge commits” in your log
- You’re contributing to public projects (never rewrite history)
Simple Git Merge Example (Command Line)
bash
# Start on main
git checkout main
# Get the latest changes
git pull
# Merge feature branch
git merge feature-login
This will create a new merge commit.
GitHub Merge Example
- Open a Pull Request (PR)
- Review and approve
- Click Merge pull request
- Select Create a merge commit
This is the most common, beginner-friendly workflow.
Advantages of Merge
- Very safe
- Beginner-friendly
- Never rewrites history
- Perfect for team collaboration
Disadvantages
- Commit history can get cluttered
- Lots of merge commits
- Not ideal for super-clean history
Git Rebase: “Let me rewrite history to make it look like I finished on time.”

Concept (Beginner Friendly)
Rebase rewrites your branch so it looks like you started working from the very latest version of main.
Picture this:
You took a photocopy of the document last week. But today, the main document has new updates. Instead of merging, you pretend you actually took your copy today by reattaching your commits to the new top.
Rebase literally “lifts” your commits and places them at the end of main.
When to Use Git Rebase
- You want a clean, linear history
- You’re working solo on a feature branch
- You want your work to appear as if it were built on the latest code
- You love tidy commit logs
Important Warning
⚠️ Never rebase a branch that other people have already pulled. Rewriting public history causes chaos.
Simple Rebase Example (Command Line)
Bash
# On your feature branch
git checkout feature-login
# Get latest main changes
git pull
# Rebase onto main
git rebase main
If there are conflicts, Git will pause and let you resolve them.
After resolving:
Bash
git add .
git rebase --continue
GitHub Rebase Example
GitHub supports “Rebase and merge”:
- Open your Pull Request
- Under merge strategy, choose Rebase and merge
- GitHub rewrites commits for you (safe because PR is your own branch)
Advantages
- Extremely clean commit history
- Perfect for maintaining tidy logs
- Good for solo developers
Disadvantages
- Rewrites history (dangerous for beginners)
- Causes confusion if misused
- More complex conflict handling
Git Cherry-pick: “I only want this one commit, not the whole branch.”

Concept (Beginner Friendly)
Cherry-pick allows you to copy a specific commit from one branch into another.
Imagine this:
Your teammate added a great paragraph to their copy of the document, and you want that paragraph too, but not the rest of their edits.
That’s cherry-picking.
When to Use Cherry-pick
- You want to move ONE commit to another branch
- Hotfixing a bug on production
- Bringing a specific feature or line of code into another branch
- Avoiding a full merge
Simple Git Cherry-Pick Example
1. Find the commit hash:
Bash
git log
2. Cherry-pick it:
bash
git checkout main
git cherry-pick 3c09fa1
Git copies that commit into main like magic.
GitHub Example
- Open the commit on GitHub
- Click Copy commit SHA
- On your local main branch:
Bash
git cherry-pick <SHA>
Advantages
- Very precise
- Great for bug fixes
- Avoids bringing unwanted commits
Disadvantages
- Can lead to duplicate commits
- Not good for big feature branches
- A little advanced for new Git users
Story Time: How PixelForge Finally Got It Right

Remember that chaotic day at PixelForge? Let’s revisit the team:
👉 Sarah
Used merge → It preserved history. Conflicts happened, but the team helped her fix them.
👉 James
Used rebase on a shared branch. Everyone panicked when commit history changed. Lesson learned: never rebase public branches.
👉 Chidi
Cherry-picked commits into the wrong branch. He learned to always double-check branch names.
👉 Mike
Used push --force. Well… we don’t talk about that.
Used merge → It preserved history. Conflicts happened, but the team helped her fix them.
👉 James
Used rebase on a shared branch. Everyone panicked when commit history changed. Lesson learned: never rebase public branches.
👉 Chidi
Cherry-picked commits into the wrong branch. He learned to always double-check branch names.
👉 Mike
Used push --force. Well… we don’t talk about that.
After that day, our lead created a simple rule:
““Merge for teamwork. Rebase for clean personal work. Cherry-pick for emergencies.””
And everything changed.And everything changed.
Conclusion: Your Git Skills Just Leveled Up
By now, you understand:
- Git merge → Safe, simple, keeps history
- Git rebase → Clean, beautiful history (but be careful!)
- Git cherry-pick → Precision copying of commits
Each tool has its place, and now you know exactly when to use which.
Just like Sarah, James, Chidi, and Mike at PixelForge Studios, you’ll be making confident Git decisions that keep your project history clean, predictable, and professional.
MK
Mike Kanu
Author
AI Software Engineer | Technical Adviser | Writter
Comments (0)
Sign in to join the conversation
