📘 #100DaysOfDevOps – Day 11 (GitHub – Day 2) Today I learned about Branching and Merging in Git 🌿 Branching is one of the most powerful features of Git. It allows developers to work on different features without affecting the main code. --- 🔹 What is a Branch? A branch is a separate line of development. 👉 Default branch: "main" --- 🔹 Why Branching is Important? • Work on features independently • Avoid breaking main code • Collaborate easily with teams --- 🔹 Important Commands Create a branch "git branch feature-1" Switch to branch "git checkout feature-1" (Create + switch) "git checkout -b feature-1" View branches "git branch" --- 🔹 Merging Branches Switch to main branch "git checkout main" Merge branch "git merge feature-1" --- 🔹 Key Concept 👉 After merging, changes from feature branch are added to main branch. --- 💡 Key Learning: Branching and merging help teams collaborate efficiently, manage features, and maintain clean code in real DevOps projects. Learning something new every day 🚀 #100DaysOfDevOps #DevOps #Git #GitHub #LearningInPublic
Git Branching and Merging for Efficient DevOps
More Relevant Posts
-
Been looking into different Git branching strategies lately and figured I'd share a quick comparison. Git Flow is probably the most well-known. It uses multiple long-lived branches like develop and master, plus feature branches. Works great for scheduled releases but can feel heavy for smaller teams. GitHub Flow is simpler. Just one main branch and feature branches. You merge to main when ready. Pretty straightforward if you deploy often. Trunk-based development takes it further. Everyone commits to main frequently, sometimes multiple times a day. Requires good CI/CD and feature flags though. There's also GitLab Flow which sits somewhere in between, using environment branches. Honestly, the best one depends on your team size, release schedule, and how often you deploy. #GitWorkflow #SoftwareEngineering #DevOps
To view or add a comment, sign in
-
📘 #100DaysOfDevOps – Day 12 (GitHub – Day 3) Today I learned about Merge Conflicts in Git and how to resolve them ⚔️ Merge conflicts happen when multiple changes are made to the same file/line in different branches, and Git is unable to decide which change to keep. --- 🔹 When do Merge Conflicts occur? • Same file edited in multiple branches • Same line modified differently • While merging branches --- 🔹 Example of Conflict <<<<<<< HEAD Hello from main branch ======= Hello from feature branch >>>>>>> feature-1 --- 🔹 How to Resolve Conflict 1️⃣ Open the conflicted file 2️⃣ Choose correct changes (or combine both) 3️⃣ Remove conflict markers ("<<<<<<", "======", ">>>>>>") 4️⃣ Add and commit changes git add file.txt git commit -m "Resolved merge conflict" --- 🔹 Useful Commands Check status "git status" Abort merge "git merge --abort" --- 🔹 Best Practices • Pull latest changes before working • Work on separate branches • Keep commits small and clear --- 💡 Key Learning: Handling merge conflicts is an essential skill for collaboration and maintaining clean code in real-world DevOps projects. Learning something new every day 🚀 #100DaysOfDevOps #DevOps #Git #GitHub #LearningInPublic
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
-
📘 #100DaysOfDevOps – Day 13 (GitHub – Day 4) Today I learned about Git Rebase vs Merge 🔀 Both are used to integrate changes from one branch to another, but they work in different ways. --- 🔹 Git Merge 👉 Combines branches and creates a merge commit git checkout main git merge feature-1 ✔ Preserves history ✔ Easy to use --- 🔹 Git Rebase 👉 Moves feature branch on top of main branch git checkout feature-1 git rebase main ✔ Creates clean linear history ✔ No extra merge commits --- 🔹 Key Difference • Merge → Keeps history as it is (branching visible) • Rebase → Rewrites history (clean & linear) --- 🔹 When to Use What? 👉 Use Merge • When working in teams • When you want full history 👉 Use Rebase • For clean commit history • Before merging feature branch --- ⚠️ Important Note Avoid rebasing shared branches (can cause issues for team) --- 💡 Key Learning: Understanding rebase vs merge helps in maintaining clean code history and better collaboration in real DevOps projects. Learning something new every day 🚀 #100DaysOfDevOps #DevOps #Git #GitHub #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Git Merge vs Rebase — Explained Simply! If you're working with Git daily, you've definitely come across merge and rebase. Both help integrate changes from one branch into another — but they do it in very different ways 👇 🔹 Git Merge Combines branches using a merge commit Preserves the complete history of both branches Best when you want to keep track of how work evolved 🔹 Git Rebase Rewrites history by placing your commits on top of another branch Creates a clean, linear commit history Ideal for keeping your repo neat and readable 💡 When to Use What? ✔ Use merge when collaborating with teams and preserving history matters ✔ Use rebase when you want a clean timeline before pushing your code 📌 Pro Tip: Avoid rebasing shared/public branches — it can create conflicts for your team. 📚 Mastering these concepts is key to becoming a strong DevOps or Software Engineer. Let me know in the comments 👇 👉 Do you prefer merge or rebase in your workflow? #Git #DevOps #VersionControl #SoftwareEngineering #Learning #TechTips
To view or add a comment, sign in
-
-
🚀 𝟗𝟎 𝐃𝐚𝐲𝐬 𝐨𝐟 𝐃𝐞𝐯𝐎𝐩𝐬 | 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐢𝐧 𝐏𝐮𝐛𝐥𝐢𝐜 | 𝐇𝐚𝐧𝐝𝐬-𝐎𝐧 | 𝐏𝐫𝐨𝐣𝐞𝐜𝐭𝐬 🌳 Branching out into Version Control: My First Git Repo! Day 22 of #90DaysOfDevOps is done! ✅ Today, I transitioned from scripting to mastering Git—the absolute backbone of DevOps and modern software engineering. 👨💻 I set up my global config, initialized my first repository, and got hands-on with the core workflow: Working Directory ➡️ git add (Staging) ➡️ git commit (Repository). ✅ git init → git add → git commit → Repeat! 💡 Biggest Aha! Moment: Understanding the Staging Area. It isn’t just an extra annoying step; it’s a drafting space that lets you group related changes together before sealing them into a commit, keeping the project history clean and logical! 🔗💻 GitHub Repo: https://lnkd.in/dZsmFiQT #90DaysOfDevOps #DevOpsKaJosh #TrainWithShubham #Git #GitHub #VersionControl #DevOpsJourney
To view or add a comment, sign in
-
🚀 #100DaysOfDevOps – Day 6 Today I practiced Git basics focusing on tracking, committing, and analyzing changes, simulating real development workflows. 🔹 Tracking & Committing Files ✔ Scenario: Tracking code/config changes before deployment ✔ Scenario: Maintaining version history for rollback Commands: git add file git commit -m "message" 🔹 Working with Multiple Files ✔ Scenario: Committing multiple configuration changes in one release Commands: git add . git commit -m "message" 🔹 Git Logs (History Tracking) ✔ Scenario: Debugging issues by checking recent changes ✔ Scenario: Understanding who changed what in the project Commands: git log git log --oneline git log -2 🔹 Git Show (Deep Analysis) ✔ Scenario: Inspecting exact code changes that caused an issue ✔ Scenario: Reviewing commit details during debugging Commands: git show <commit-id> git show <commit-id> --name-only 🔹 Git Config ✔ Setting up identity for commits Commands: git config user.name "username" git config user.email "email" 💡 Git plays a key role in code versioning, collaboration, and production debugging in DevOps workflows. Every commit tells a story — learning to read and manage it effectively. 💪 #Git #DevOps #CloudEngineering #VersionControl #100DaysChallenge #ContinuousLearning
To view or add a comment, sign in
-
-
🚀 Day 10 – DevOps 100 Days Challenge 🚀 Today, I deepened my understanding of advanced Git concepts, which are essential for managing code history, fixing mistakes, and working efficiently in real‑world projects. 📌 What I learned today in Git: Git Config – setting username, email, and global configurations Git Commit --amend – updating the last commit Git Reset – undoing changes and reset commit states .gitignore – ignoring unnecessary files and directories Git Reflog – tracking and recovering lost commits Git Cherry-pick – applying specific commits from one branch to another These concepts help handle mistakes confidently, maintain clean commit history, and improve collaboration in DevOps and CI/CD workflows. 🔧📦 Feeling more confident with Git internals and moving ahead to Day 11! 💪🚀 #DevOps #100DaysOfDevOps #Git #VersionControl #GitReflog #GitReset #GitCherryPick #LearningJourney #ContinuousLearning
To view or add a comment, sign in
-
🚀 #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
-
-
Git Series | Day 3 🔄 I used to think merging branches was complicated. Turns out, sometimes Git just... slides. Today I learned about Fast-Forward merges — and it genuinely changed how I think about branch history. Here's the simple mental model: → You create a feature branch off master → You do your work (f1, f2) → Meanwhile, master hasn't moved → Git doesn't need a new commit — it just moves the master pointer forward to f2 That's it. Clean. Linear. No mess. Why does this matter in DevOps? In a CI/CD pipeline, a clean git log isn't just aesthetic — it's operational. Auditing deployments, tracing bugs, rolling back changes — all of it gets harder when your history is tangled. Fast-forward = linear history = fewer headaches in production. Day 3 done. Building one concept at a time. 🚀 #Git #DevOps #100DaysOfCode #VersionControl #CI/CD
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