🚀 Day 24 of #90DaysOfDevOps — Advanced Git: Merge, Rebase, Stash & Cherry-Pick Learning went beyond creating branches — it was about how work comes back together and how developers manage real-world workflows. Even though I’ve used these concepts throughout my industry experience, going back to basics always strengthens clarity and confidence. Here’s what I explored 👇 🔹 Git Merge ✔ Fast-forward merge keeps history simple ✔ Merge commit preserves branch history ✔ Learned how merge conflicts happen & how to resolve them 🔹 Git Rebase ✔ Rewrites commit history for a clean timeline ✔ Makes history linear and easier to read ✔ Reminder: never rebase shared commits 🔹 Squash vs Regular Merge ✔ Squash merge combines many small commits into one ✔ Regular merge preserves detailed history ✔ Trade-off between clarity and traceability 🔹 Git Stash ✔ Saved work-in-progress without committing ✔ Switched branches safely during urgent tasks ✔ Learned difference between stash pop and stash apply 🔹 Cherry-Pick ✔ Applied a specific commit from another branch ✔ Useful for hotfixes and selective updates ✔ Can cause duplicate history if overused 💡 Big takeaway: These commands separate beginners from confident practitioners. They help maintain clean history, support collaboration, and handle real-world interruptions effectively. Git isn’t just version control — it’s a collaboration engine. #Git #DevOps #VersionControl #SoftwareEngineering #90DaysOfDevOps #DevOpsJourney
Git Merge, Rebase, Stash & Cherry-Pick: Mastering Advanced Git Commands
More Relevant Posts
-
🚀 Day 24 & 25 – From Basic Git to Real Engineering Git Most people learn: 👉 git add 👉 git commit 👉 git push But real engineers master: ✅ Merge vs Rebase ✅ Stash & Cherry Pick ✅ Reset vs Revert ✅ Branching Strategies This week I went deep into advanced Git workflows — the skills that separate beginners from confident developers. 🔀 Day 24 – Advanced Git 🔁 Merge vs Rebase Learned how fast-forward merge works. Understood when Git creates a merge commit. Practiced git rebase and saw how it rewrites history. Key rule: Never rebase shared branches. 📦 Git Stash Mid-feature but urgent bug? git stash saves your unfinished work like a temporary locker. Real-world lifesaver. 🍒 Cherry Pick Needed only ONE fix from a branch? git cherry-pick <commit> Applied a single commit without merging everything. Powerful. Dangerous if misused. 🔥 Day 25 – Undoing Mistakes Like a Pro 🟢 git reset --soft → Undo commit, keep staged changes --mixed → Undo commit, keep working changes --hard → Deletes everything (danger zone ⚠️) Rule: Never reset pushed commits. 🔄 git revert Safely undo changes by creating a new commit. ✔ Keeps history ✔ Safe for teams ✔ Production-friendly 🌳 Branching Strategies I Explored GitFlow Best for large teams with release cycles. GitHub Flow Simple + fast + PR based. Perfect for startups shipping quickly. Trunk-Based Development Short-lived branches + strong CI. Used by high-performance teams. 🧠 Biggest Lessons Merge preserves history. Rebase rewrites history. Reset deletes. Revert protects. Stash saves your context. Cherry-pick isolates fixes. Strategy depends on team size and release model. Git is not just commands — it’s engineering discipline. This DevOps journey is getting deeper every day. Day 24 & 25 complete ✅ Consistency > Motivation. #DevOps #Git #OpenSource #SoftwareEngineering #100DaysOfDevOps #LearningInPublic #VersionControl #DevOpsKaJosh #TrainWithShubham
To view or add a comment, sign in
-
-
🚀 #90DaysOfDevOps – Day 24 📚 What I Learned Today in Git (Hands-On Practice) Today I spent time practicing some important Git concepts that are widely used in real development workflows. Here’s a quick summary of what I learned 👇 ✅ Git Merge — Hands-On Learned how to combine changes from different branches and understood when Git creates a fast-forward merge vs a merge commit. ✅ Git Rebase — Hands-On Practiced rebasing a feature branch onto main to create a clean and linear commit history. ✅ Squash Commit vs Merge Commit Understood how squash merging combines multiple commits into one to keep the project history cleaner. ✅ Git Stash — Hands-On Learned how to temporarily save uncommitted work using git stash so I can switch branches without losing changes. Commands practiced: git stash git stash list git stash pop ✅ Cherry Picking Practiced copying a specific commit from one branch to another using: git cherry-pick <commit-id> This is useful when you want a particular fix or feature without merging the entire branch. 💡 Key takeaway: Understanding these Git workflows makes branch management, collaboration, and debugging much easier. 📌 Access the full Cheat Sheet here:https://lnkd.in/g24UG_TW #Git #DevOps #VersionControl #LearningInPublic #SoftwareDevelopment #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #ShubhamLondhe
To view or add a comment, sign in
-
🚀 Day 24 – Advanced Git: Merge vs Rebase vs Stash vs Cherry-Pick Today I moved beyond basic Git usage and stepped into real-world workflows. This is where Git stops being “just version control” and starts becoming a collaboration power tool. 🔀 1️⃣ Merge vs Fast-Forward vs Merge Commit I practiced: ✅ Fast-forward merge ✅ Merge commit (non-linear history) ✅ Creating intentional merge conflicts 💡 Realization: If main hasn’t moved → Git does a fast-forward If both branches have new commits → Git creates a merge commit If the same line is edited → 💥 Merge conflict Seeing git log --oneline --graph --all changed everything. History tells the full story. 🔁 2️⃣ Rebase – Clean History Mode Rebase rewrites commit history by replaying commits on top of another branch. 📌 Merge → Branching history 📌 Rebase → Linear history ⚠️ Important Rule: Never rebase commits that are already pushed and shared. Because rebase changes commit hashes → and breaks collaboration. 🧳 3️⃣ Git Stash – Context Switching Like a Pro Started working → urgent task came → didn’t want to commit messy code. Used: git stash git stash pop Saved work instantly without committing. This is how professionals handle interruptions. 🎯 4️⃣ Cherry Pick – Surgical Commit Transfer Needed only one commit from a feature branch. Used: git cherry-pick <commit-hash> Only that specific change was applied. Powerful for: ✔ Hotfixes ✔ Production patches ✔ Backporting fixes 🧠 Biggest Learning Today Git isn’t about commands. It’s about history control. ✔ Merge → Collaboration ✔ Rebase → Clean history ✔ Stash → Flexibility ✔ Cherry-pick → Precision Now I understand how real DevOps teams manage code safely. Small steps. Strong foundations. 💪 #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Git #DevOpsJourney #VersionControl #LearningInPublic
To view or add a comment, sign in
-
Git Merge, Rebase, and Squash — three ways to integrate changes, each solving a different workflow problem. Understanding when to use each one can save your repo (and your teammates) a lot of pain. ⏬ Git Merge Creates a new merge commit and preserves full history. • Best for: merging feature branches into main in collaborative teams • Why: no history is rewritten—everyone’s work stays intact • Trade-off: history can become noisy 🔀 Git Rebase Rewrites commit history by replaying commits on top of another branch. • Best for: maintaining a clean, linear history • Why: easier to read and debug • Rule: never rebase shared or public branches 🧼 Git Squash Combines multiple commits into a single, meaningful commit. • Best for: cleaning up experimental or WIP commits before merging • Why: keeps main focused on atomic, high-quality changes 🧠 When to Use What • Merge → when collaboration and full history matter • Rebase → when you want a straight-line commit timeline • Squash → when finalizing clean, review-ready changes A good Git strategy keeps your repository readable, traceable, and team-friendly. 💬 What’s your default approach—merge commits, rebase, or squash-and-merge? #Git #DevOps #SoftwareEngineering #VersionControl #OpenSource #DeveloperTools #BestPractices
To view or add a comment, sign in
-
-
🚀 Git Merge vs Git Rebase — A concept that confuses almost every developer at some point When working with Git, you'll often hear the debate: Should you use git merge or git rebase? Both commands combine changes from different branches — but they do it in very different ways. 🔀 Git Merge git merge combines two branches by creating a merge commit. What this means: • The full history of both branches is preserved • You can clearly see when branches diverged and merged • It does not rewrite commit history This approach is very safe for shared branches and team collaboration, which is why many teams prefer merge-based workflows. 📏 Git Rebase git rebase works differently. Instead of creating a merge commit, it moves (replays) your commits on top of another branch. What this results in: • A clean, linear commit history • No extra merge commits • But it rewrites commit history Because of this, rebasing is usually recommended for local branches before pushing code. ⚠️ A common rule developers follow: ✔ Use Merge for public/shared branches ✔ Use Rebase for cleaning up local commit history Understanding this difference can make your Git history much easier to read and maintain — especially in large teams. If you're learning Git, mastering these two commands is a big milestone. 💡 Which one does your team prefer — Merge or Rebase? Do let me know in the comments. #Git #DevOps #SoftwareEngineering #Programming #Developers #Coding #GitHub #TechLearning #DeveloperTools #Engineering
To view or add a comment, sign in
-
🚀 The Complete Git & GitHub Workflow Every Developer Should Master (From your local machine to production — without losing control of your code) Git is not just about commit and push. It’s about control, collaboration, traceability, and security in development. When you truly understand the workflow, your level as an engineer changes completely. Here’s the complete flow explained in a simple and practical way 👇 1️⃣ Working Directory — Where Everything Begins This is where you write code, create files, and make real changes. Key command: git init → Initialize a repository. Everything starts here. 2️⃣ Staging Area — Preparing the Commit Here you decide exactly which changes will be recorded. Key command: git add . → Send changes to staging. This is precise version control. 3️⃣ Local Repository — Your Project’s History You save snapshots of your project through commits. Key command: git commit -m "message" This becomes your project’s timeline. 4️⃣ Branching — Develop Without Breaking Production Work on features independently without affecting main. Key commands: git branch feature-x git checkout feature-x This enables real parallel development. 5️⃣ Merge — Integrating Changes Combine branches once a feature is ready. Key command: git merge feature-x This is where conflicts either appear… or get resolved. 6️⃣ Remote Repository — Global Collaboration Your code lives on platforms like GitHub, GitLab, or Bitbucket. Key command: git push origin main This keeps your team synchronized. 7️⃣ Fetch vs Pull — Know the Difference git fetch → Retrieves changes without merging. git pull → Retrieves and merges automatically. Pull = Fetch + Merge. Understanding this prevents mistakes. 8️⃣ Pull Request — Quality Control Layer Before merging to main: • Code review • CI/CD checks • Validation • Team discussion This is where software quality is protected. 9️⃣ The Professional Workflow (What Senior Teams Actually Use) git checkout -b feature Code + small commits git push origin feature Pull Request + CI/CD Code Review Merge to main Deploy 🚀 Advanced Git Mindset • Small commits > massive commits • One branch per feature • Never work directly on main • Pull before you push • CI/CD is your quality guardian Which workflow does your team use? 🌿 Git Flow 🚀 Trunk-Based Development ⚡ GitHub Flow 🔧 Custom Strategy Let’s discuss 👇 #Git #GitHub #VersionControl #SoftwareEngineering #DevOps #CICD #Programming #EngineeringWorkflow
To view or add a comment, sign in
-
-
Day 24 of #90DaysOfDevOps – Advanced Git (Now It’s Getting Serious) Today Git officially humbled me… and then taught me a lot. Until now, I was comfortable with branching and pushing. But today I learned what really happens when branches come back together. Here’s what I worked on: • Fast-forward merge • Merge commit • Creating and resolving real merge conflicts • Rebase (and rewriting history) • Squash merge vs regular merge • Git stash for context switching • Cherry-pick for selective commit transfer The biggest realization? Merge preserves history. Rebase rewrites history. And rewriting history is powerful… but dangerous if used carelessly. Creating an intentional merge conflict and resolving it manually was a real learning moment. Seeing Git insert conflict markers made me understand that version control is not magic — it’s logic. Rebase gave me a clean linear history, but it also showed me why we should never rebase shared branches. Stash felt like a productivity superpower — saving unfinished work without committing junk. Cherry-pick made me realize how precise Git can be. You don’t always need the whole branch — sometimes you just need one commit. Day by day, this challenge is shifting me from “running Git commands” to actually understanding version control workflows. Consistency continues. On to Day 25. #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Git #DevOpsJourney #LearningInPublic
To view or add a comment, sign in
-
🚀 Day 23 of #90DaysOfDevOps – Git Branching & Working with GitHub Today I explored one of the most powerful concepts in Git: branching 🌿 Branches allow developers to work on new features, bug fixes, or experiments without breaking the main codebase — making collaboration safer and more organized. Even though I’ve used these concepts extensively in my industry experience, it always feels good to go back to basics. Revisiting fundamentals strengthens clarity, reinforces best practices, and often reveals insights we overlook in day-to-day work. 🔹 What I Practiced Today ✅ Understanding what Git branches are and why they matter ✅ Switching between branches & managing changes ✅ Using git switch vs git checkout ✅ Creating feature branches and isolating commits ✅ Deleting unused branches ✅ Connecting a local repo to GitHub & pushing branches ✅ Making changes directly on GitHub & pulling updates locally ✅ Learning origin vs upstream ✅ Understanding git fetch vs git pull ✅ Exploring clone vs fork and keeping forks in sync 💡 Key Learnings 🔹 A branch is an independent line of development 🔹 HEAD points to your current branch/commit 🔹 Switching branches changes your working directory files 🔹 origin = your remote repo, upstream = original source repo 🔹 fetch downloads changes, pull downloads + merges 🔹 Forking is essential when contributing to others’ projects Pushed my practice repo and feature branches to GitHub — seeing multiple branches live felt like leveling up! 💻✨ Every day I’m realizing that Git isn’t just a tool — it’s the backbone of collaborative development. #90DaysOfDevOps #DevOpsJourney #Git #VersionControl #LearningInPublic #DevOpsKaJosh #TrainWithShubham
To view or add a comment, sign in
-
Today was all about understanding Git deeply — not just commands, but the logic behind version control. 🔹 What I Learned ✅ What Version Control actually means → Tracking every change in code → Ability to revert to previous versions → Safe collaboration without overwriting others’ work ✅ Core Git Commands: git init git clone git status git add git commit git log ✅ Branching Concept I finally understood why branches are powerful. Feature branches allow safe experimentation without affecting the main codebase. ✅ Merge vs Rebase Merge keeps history visible Rebase keeps history clean Understanding this cleared a big confusion for me. ✅ Handling Merge Conflicts This is where real learning happens. Instead of fearing conflicts, I now see them as part of collaboration. 🔥 Key Realization Git is not just a tool. It is: The foundation of CI/CD The backbone of team collaboration The first step toward automation Without Git, DevOps cannot exist. #DevOps #Git #VersionControl #LearningInPublic #FutureDevOpsEngineer
To view or add a comment, sign in
-
Day 25 | #90DaysOfDevOps🚀 — Mastering Advanced Git Commands Today I focused on learning and practicing some powerful Git commands that help developers manage code safely and efficiently. Understanding these commands is essential for real-world collaboration and version control. 🔧 What I practiced today: ✅ Git Reset – Learned how to undo commits in different ways: --soft → keeps changes staged --mixed → keeps changes but unstaged --hard → removes commits and deletes changes ✅ Git Revert – Safely undo a commit by creating a new commit without rewriting history. This is the recommended approach for shared repositories. ✅ Handling Merge Conflicts – While reverting a commit, I encountered a conflict and learned how to manually resolve it and continue the revert process. 📚 Updated my Git command reference to include: Setup & Configuration Basic Git Workflow Branching Remote repositories Merging & Rebasing Stash & Cherry Pick Reset & Revert #DevOps #Git #VersionControl #LearningInPublic #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development