Sumit Saurabh
sumit.bsky.social
Sumit Saurabh
@sumit.bsky.social
Full Stack Dev | 🥑 Developer Advocate 🚀 | Public Speaker 🎤 | Talks about Javascript, React, Open Source and web dev
I hope you've found this thread helpful and learnt something new.

If you did:

✅ Follow me @sumitsaurabh927 for more.
✅ Like and comment down below
✅ Repost the quote below:
March 4, 2025 at 2:34 PM
Join a community of early-age developers and level up:
discord.gg/pjTvDtE2
Join the Aviator - Developer Productivity Community Discord Server!
Check out the Aviator - Developer Productivity Community community on Discord - hang out with 328 other members and enjoy free voice and text chat.
discord.com
March 4, 2025 at 2:34 PM
🔟 Final Takeaway: Use Git Stash Wisely

✔️ Great for quick, temporary saves
❌ Not a replacement for commits
💡 When in doubt, create a branch instead
March 4, 2025 at 2:34 PM
9️⃣ Bonus: Recovering a Dropped Stash 😱

Accidentally dropped a stash? You might still recover it:

Try: git fsck --lost-found and look for stash-like commits.
March 4, 2025 at 2:34 PM
8️⃣ Managing & Cleaning Up Stashes

🗑 Clear all stashes: git stash clear
🗑 Delete a specific stash: git stash drop stash@{1}

Pro tip: If you use stashes often, clean them up regularly!
March 4, 2025 at 2:34 PM
7️⃣ Better Alternatives to git stash

🚀 Use WIP commits: git commit -m "WIP"
🚀 Create a temporary branch
🚀 Use git worktree for parallel work
March 4, 2025 at 2:34 PM
6️⃣ When You Shouldn’t Use git stash ❌

🚨 If your work is important (stashes aren’t safe long-term)
🚨 If you switch tasks often (easy to forget stashes)
🚨 If you need team visibility (stashes are local, not shared)
March 4, 2025 at 2:34 PM
5️⃣ When You Should Use git stash ✅

✔️ Switching branches temporarily
✔️ Need a clean working directory for testing
✔️ Quickly save work without committing
March 4, 2025 at 2:34 PM
4️⃣ Applying a Specific Stash

If you have multiple stashes, apply a specific one using:

git stash apply stash@{2}

This applies the 3rd stash in your history (zero-based index).
March 4, 2025 at 2:34 PM
3️⃣ Keep Track of Stashes with Messages

By default, stashes are unnamed, which can get messy. Instead, use:

📝 git stash push -m "WIP: Fixing login bug"
📜 View stash history: git stash list
March 4, 2025 at 2:34 PM
2️⃣ The Basics: Stashing and Applying

🗄 Stash changes: git stash
♻️ Apply latest stash: git stash pop (removes it from stash history)
🔄 Apply without removing: git stash apply
March 4, 2025 at 2:34 PM
1️⃣ What Is git stash?

🔹 Temporarily saves uncommitted changes
🔹 Cleans your working directory
🔹 Lets you switch branches without committing
🔹 Think of it as a clipboard for your code
March 4, 2025 at 2:34 PM
I hope you've found this thread helpful and learnt something new.

If you did:

✅ Follow me @sumitsaurabh927 for more.
✅ Like and comment down below
✅ Repost the quote below:
March 3, 2025 at 4:05 PM
Don't forget to checkout our completely free tool 'av' cooked in the kitchens of @Aviator_co_ 🍜

It helps you create and manage stacked PRs completely free.

🔗: github.com/aviator-co/av
GitHub - aviator-co/av: A command line tool to manage stacked PRs with Aviator
A command line tool to manage stacked PRs with Aviator - aviator-co/av
github.com
March 3, 2025 at 4:05 PM
7️⃣ Bonus: Stacked PRs Work Best With Feature Flags 🚩

🔹 Ship incomplete features behind flags
🔹 Merge incrementally without affecting users
🔹 Reduce risk of breaking production
March 3, 2025 at 4:05 PM
6️⃣ Merge Strategy: Bottom-Up vs. Top-Down

🔹 Bottom-up: Merge base PR first, then the next
🔹 Top-down: Rebase from the base PR as you go

Tools like gh stack & av make this effortless!
March 3, 2025 at 4:05 PM
5️⃣ Example: Adding a Dark Mode Feature 🌙

❌ One Big PR – Backend, API, UI, styles, settings all in one = 🔥
✅ Stacked PRs:
1️⃣ Backend: Store dark mode preference
2️⃣ API: Expose preference
3️⃣ UI: Toggle switch + styles

Much easier to review!
March 3, 2025 at 4:05 PM
4️⃣ Developers Benefit Too 🚀

🔹 Less waiting for approvals
🔹 Merge work incrementally instead of all at once
🔹 Avoid rewriting code due to delayed feedback
🔹 Keep main branch stable while shipping fast
March 3, 2025 at 4:05 PM
3️⃣ Reviewers Love Stacked PRs ❤️

✅ Faster reviews (small changes = quick feedback)
✅ Focused discussions (each PR solves one problem)
✅ Fewer merge conflicts (less code churn)
✅ Easier debugging (pinpoint issues in smaller PRs)
March 3, 2025 at 4:05 PM
2️⃣ What Are Stacked PRs?

🔹 A sequence of smaller, dependent PRs
🔹 Each PR builds on the previous one
🔹 Easier to review since each PR focuses on a single step

Example:
✅ PR 1: Refactor DB schema
✅ PR 2: API changes
✅ PR 3: Update UI
March 3, 2025 at 4:05 PM
1️⃣ Big PRs = Big Problems

❌ Hard to review
❌ Reviewers get lost in too many changes
❌ Endless back & forth slows progress
❌ Rubber-stamping leads to hidden bugs

Stacked PRs fix this 👇
March 3, 2025 at 4:05 PM
I hope you've found this thread helpful and learnt something new.

If you did:

✅ Follow me @sumitsaurabh927 for more.
✅ Like and comment down below
✅ Repost the quote below:
March 1, 2025 at 1:58 PM
Don't forget to checkout our completely free tool 'av' cooked in the kitchens of @Aviator_co_ 🍜

It helps you create and manage stacked PRs completely free.

🔗: github.com/aviator-co/av
GitHub - aviator-co/av: A command line tool to manage stacked PRs with Aviator
A command line tool to manage stacked PRs with Aviator - aviator-co/av
github.com
March 1, 2025 at 1:58 PM