🚀 #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
Git Hands-On Practice: Merge, Rebase, Stash & Cherry Pick
More Relevant Posts
-
🚀 #100DaysOfDevOps – Day 9 Today I practiced Git branching strategies, merge vs rebase, and stash operations, focusing on real-time development scenarios. 🔹 Git Branching (Parallel Development) ✔ Scenario: Creating feature branches for new tasks without impacting main code ✔ Scenario: Working on bug fixes while another feature is in progress Commands: git branch git checkout -b feature-branch 🔹 Git Merge (Combining Code) ✔ Scenario: Merging tested feature branch into main before deployment ✔ Scenario: Integrating multiple developer changes Command: git merge branch-name 🔹 Git Rebase (Clean Commit History) ✔ Scenario: Updating feature branch with latest main branch changes ✔ Scenario: Maintaining a clean and linear commit history before PR Command: git rebase main 🔹 Merge vs Rebase (Real Use Case) ✔ Merge → preserves history (used in team collaboration) ✔ Rebase → cleaner history (used before pushing changes) 🔹 Git Stash (Context Switching) ✔ Scenario: Urgent production issue comes → stash current work and switch branch ✔ Scenario: Saving incomplete work without committing Commands: git stash git stash apply git stash list git stash pop 💡 These commands are essential for real-time collaboration, handling multiple tasks, and managing clean code history in DevOps environments. Learning how teams actually work with Git in production. 💪 #Git #DevOps #VersionControl #Branching #Rebase #Stash #100DaysChallenge #ContinuousLearning
To view or add a comment, sign in
-
-
🚨 ONE WRONG GIT MERGE TAUGHT ME MORE THAN ANY DOCUMENTATION I used to think Git was simple. 👉 git add 👉 git commit 👉 git push That’s it. Then one day… I merged my code. And things didn’t feel right. 💥 APIs behaved differently 💥 Code didn’t match expectations 💥 Debugging became confusing That’s when I realized something important: 👉 Git is not about commands. 👉 It’s about understanding what happens behind the scenes. In real DevOps: multiple developers push code at the same time production keeps changing your code can become outdated without you noticing And if you don’t understand this… 👉 One wrong merge can break everything. 💡 What changed for me: Instead of blindly using commands… I started asking: 👉 What is Git actually doing here? 👉 Is my code up to date? 👉 Am I mixing old and new changes? That’s when everything became clear. 🚀 Now I understand: merge mixes timelines rebase updates your work revert safely fixes mistakes And more importantly: 👉 When to use them 💡 Git is not difficult. It just becomes powerful… 👉 when you stop memorizing commands 👉 and start understanding behaviour 🔥 Real learning doesn’t happen when everything works. 👉 It happens when things break… and you fix them. 👇 I wrote a full hands-on blog with real examples, commands, and outputs: https://lnkd.in/g-z_C3a8 #️⃣ #Git #DevOps #LearningInPublic #Debugging #CareerGrowth
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
-
🚀 How Git Works – Real Impact for Developers Every developer uses Git… but not everyone understands its real power. Here’s how Git actually impacts your day-to-day development 👇 🔥 1. You Stop Fearing Mistakes Accidentally broke something? ➡️ Just revert, reset, or checkout a previous commit. Git gives you confidence to experiment. ⚡ 2. Cleaner & Organized Workflow With proper use of: ✔️ "git add" (staging) ✔️ "git commit" (versioning) ✔️ "git push" (sharing) You maintain a clean and trackable code history. 🤝 3. Team Collaboration Becomes Easy No more “who changed my code?” ➡️ Use branches, pull requests, and merges smoothly. 🔍 4. Debugging Becomes Faster Git history = your debugging superpower ➡️ Find bugs using commit logs and changes timeline 🌍 5. Industry-Level Development Practice Tools like GitHub, GitLab, and Bitbucket rely on Git ➡️ Mastering Git = working like a professional developer 💡 Golden Flow to Remember: Workspace → Staging → Local Repo → Remote Repo 🎯 Pro Insight: "git pull = git fetch + git merge" 📌 If you truly understand this flow from the image, you’re already ahead of many developers. 💬 What Git mistake taught you the biggest lesson? #Git #Developers #SoftwareDevelopment #CodingLife #TechSkills #MERN #Backend #Learning #CareerGrowth
To view or add a comment, sign in
-
-
🚨 Advanced Git Mistakes Developers Still Make Git is one of the most powerful tools we use daily… but also one of the most commonly misused. The truth? Most issues in teams don’t come from code — they come from poor Git practices. ⸻ 💡 Small mistakes like: • Writing vague commit messages • Pushing directly to main • Skipping git pull before push • Not using branches properly • Ignoring .gitignore 👉 These seem minor… but they create major problems later. Conflicts. Broken builds. Confusing history. Wasted time. ⸻ ⚡ Good developers write code. Great developers maintain clean systems. And Git is a big part of that system. Because when your version control is clean: • Collaboration becomes smoother 🤝 • Debugging becomes easier 🔍 • Scaling projects becomes faster 🚀 ⸻ 💡 The real takeaway: Git is not just a tool — it’s a discipline. Write better commits. Use branches properly. Think before you push. ⸻ 🔥 Final Thought: Clean Git habits today = fewer headaches tomorrow. ⸻ 💬 What’s one Git mistake you learned the hard way? #Git #Developers #Programming #SoftwareEngineering #WebDevelopment #Coding #TechTips #VersionControl #BackendDevelopment #CleanCode
To view or add a comment, sign in
-
-
🚨 I BROKE MY PRODUCTION CODE… AND GIT SAVED ME 🚨 Everything was working fine. One small change. One commit. One push. And suddenly… everything stopped working. No error from Git. No warning. 👉 That’s when I realized something important: Git doesn’t check if your code is correct. It only tracks what you change. 💥 What happened next changed my understanding: Instead of panicking, I investigated using: git diff git status git log And then I used: 👉 git revert Not reset. Not delete. 👉 Revert. 🚀 Why? Because in real DevOps: ✔️ You don’t delete history ✔️ You don’t break team workflow ✔️ You fix production safely 🔥 This experience completely changed how I see Git: 👉 It’s not just version control 👉 It’s a recovery system I wrote a detailed blog explaining: ✔️ What happened ✔️ Why it happened ✔️ How I fixed it ✔️ Real DevOps insights 👉 Read here:https://lnkd.in/gUF_NY-Z 💡 If you’re learning Git, don’t just learn commands. 👉 Learn what happens when things go wrong. That’s where real learning starts. #DevOps #Git #Debugging #LearningInPublic
To view or add a comment, sign in
-
📌 Git Workflow and Commands Most engineers believe Git mastery is about memorizing a bunch of obscure commands 🤯. It's not — it's about understanding the right patterns and workflows to save your skin in a crisis. ``` Branch: main + develop + feature/* Commit: Conventional commits, GPG signed PR Flow: 2-reviewer gate, squash merge Rebase: Clean history, no merge noise Recovery: reset, reflog, cherry-pick Myth: Gitflow is the only way to manage branches 🌟. Reality: Trunk-based development can be just as effective, if not more, with the right commit and PR flow strategies in place 🚀. Senior engineers use Git differently — they focus on simplicity, clean history, and a solid understanding of recovery commands 💻. They know that a well-crafted commit message and a 2-reviewer gate can save hours of debugging time 🕒. 💬 What's your go-to Git strategy: 1️⃣ Branch 2️⃣ Commit 3️⃣ PR Flow 1️⃣ Branch 2️⃣ Commit 3️⃣ PR Flow Rebase mastery, or Recovery techniques? #GitMastery #DevTools #CodeQuality #VersionControl #SoftwareEngineering
To view or add a comment, sign in
-
-
🚀 4 Days of Deep Diving into Git — From Basics to Real-World Workflows Over the past few days, I’ve taken a focused approach to mastering Git — not just running commands, but truly understanding how it works under the hood. Here’s what I’ve covered: 🔹 Core Git Concepts • Working directory → staging area → commits • Understanding Git as a snapshot-based system 🔹 Branching & Collaboration • Creating feature branches and merging safely • Handling merge conflicts confidently • Working with pull requests and clean workflows 🔹 Debugging & Inspection • Using git diff, git diff --staged, and git blame • Reading commit history with git log --oneline --graph 🔹 Undoing & Recovery • Mastering git reset (soft, mixed, hard) • Recovering lost work using git reflog 🔹 History Management • Editing commits with --amend • Cleaning history with rebase & squash • Moving changes between branches with cherry-pick 🔹 Git Hygiene & Best Practices • Using .gitignore to protect sensitive data • Understanding why secrets should never be committed • Practicing safe workflows for team environments 💡 Key takeaway: Git isn’t just about files — it’s about managing history, understanding states, and working safely in collaborative environments. This journey has taken me from basic usage to confidently handling real-world Git scenarios, including debugging, recovery, and clean workflows. Next step: continuing my DevOps journey and applying these skills in real projects 🚀 #Git #DevOps #SoftwareDevelopment #LearningInPublic #OpenToWork #CoderCo
To view or add a comment, sign in
-
-
Merge conflict? More like git telling you, “teamwork needs clarity.” While working with Git, hitting a merge conflict is almost inevitable, and honestly, it’s not a problem; it’s a signal. It means multiple changes are competing for the same piece of code. >> Why do merge conflicts happen? • Multiple developers edit the same file/lines • Long-lived branches diverge too much • Pulling updates after making local changes • Poor coordination in collaborative workflows >> How to handle them: ✔ Carefully read conflict markers (<<<<<<<, =======, >>>>>>>) ✔ Understand both changes → don’t just pick one blindly ✔ Combine logic where needed instead of overwriting ✔ Test the code after resolving (this step is underrated) >> How to avoid them (Important): ‣ Pull frequently → stay in sync with the main branch ‣ Keep branches short-lived ‣ Work on smaller, focused commits ‣ Communicate with your team when working on shared files Learning: Merge conflicts aren’t errors; they’re decision points. They force you to understand the code better and collaborate more effectively. Every conflict resolved = better Git skills + better teamwork Drop your moments where you came across a messy merge conflict, and how you resolved it! #Git #VersionControl #MergeConflict #SoftwareDevelopment #DeveloperLife #Coding #TechLearning #Collaboration #Programming #DevTips
To view or add a comment, sign in
-
Explore related topics
- How to Use Git for IT Professionals
- How to Use Git for Version Control
- How to Understand Git Basics
- DevOps Principles and Practices
- How to Optimize DEVOPS Processes
- Tips for Continuous Improvement in DevOps Practices
- Best Practices for DEVOPS and Security Integration
- GitHub Code Review Workflow Best Practices
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