📘 #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
Resolving Git Merge Conflicts with GitHub
More Relevant Posts
-
🚀 𝟗𝟎 𝐃𝐚𝐲𝐬 𝐨𝐟 𝐃𝐞𝐯𝐎𝐩𝐬 | 𝐋𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐢𝐧 𝐏𝐮𝐛𝐥𝐢𝐜 | 𝐇𝐚𝐧𝐝𝐬-𝐎𝐧 | 𝐏𝐫𝐨𝐣𝐞𝐜𝐭𝐬 🌳 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
-
👨💻 50-day journey to revisit and strengthen my DevOps engineering skills 📌 Day 2/50 📌 ⚙️ Tools I’ll be working with: Git | GitHub Actions Today, I focused on how local Git operations turn into real CI/CD execution using GitHub Actions. In production environments, every pipeline execution is a result of developer actions performed locally, making it critical to understand the complete flow from code creation to deployment trigger. 🔄 Flow Overview: 💠 Developer writes code locally 💠 Commits and pushes using Git 💠 Code is pushed to GitHub 💠 GitHub Actions workflow is triggered 💠 CI/CD pipeline executes (build, test, deploy) ➡️ Flow attached below 👇 📌 Note: Key CI/CD stability considerations as covered in Day 1 are critical. ➡️ For a more detailed understanding of GitHub Workflows and Actions, I’ve referred to the official documentation—feel free to explore it for deeper insights 🔗 https://lnkd.in/gm77PY7y 🚨 Possible Issue Scenario: A CI pipeline was set to trigger on every push to the main branch. A developer pushed changes without syncing with the latest remote updates, causing merge conflicts and pipeline failure due to inconsistent code. 🛠️ Resolution: Pulled latest changes from the repository Resolved conflicts locally Pushed updated code Pipeline re-triggered and executed successfully 💡 Always sync before pushing. ➡️ The key takeaway is that CI/CD pipelines are only as reliable as the version control practices behind them. Proper use of git pull, disciplined commits, and clean synchronization between local and remote repositories ensures smooth pipeline execution and avoids unnecessary failures. #DevOps #git #cicd #Github #skills #GithubCommands #Branchingstrategy #GithubActions #GithubDocs #Reskill #Workflow #Syntax
To view or add a comment, sign in
-
-
DevOps Concept of the Day: Git Basics Git tracks every code change, enabling collaboration, rollbacks, and full audit history. Commits = snapshots, branches = parallel work, pull requests = review gates to merge. Today's DevOps/MLOps update (ArgoCD): stable: Bump version to 3.3.7 on release-3.3 branch (#27377) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by:… https://lnkd.in/dcsfY_Ni Why it matters: Staying current with releases means your pipelines stay secure, efficient, and compatible. #Git #DevOps #VersionControl #GitHub
To view or add a comment, sign in
-
While learning, I discovered that as a DevOps engineer, Git is not only where code lives. It is where: • Infrastructure configurations are stored • Terraform files are versioned • CI/CD pipelines are managed • Bash and PowerShell scripts are tracked • Teams collaborate without overwriting each other’s work The beauty of Git is that it gives you history. If something breaks, you can trace what changed. If you make a mistake, you can roll back. If multiple people are working together, everyone can contribute without chaos. Concepts that once sounded confusing are now starting to make sense: • git clone → bring a project from the remote repository to your local machine • git add . → prepare your changes • git commit -m "message" → save a snapshot of those changes • git push → send your changes to the remote repository • git pull → get the latest updates from others I now see Git as the memory of a project. Without it, DevOps would feel like trying to build a house with no blueprint and no record of what has changed. What Git command or concept took you the longest to understand? #Git #DevOps #CloudComputing #VersionControl #LearningInPublic #TechJourney #CI_CD
To view or add a comment, sign in
-
-
🚀 Day 39 – Git Merge Conflicts & Resolution ⚠️🔧 Today I learned about merge conflicts in Git and how to resolve them — an important skill when working in team projects 💻 ⚠️ What is a Merge Conflict? A merge conflict occurs when two changes are made to the same file or line of code in different branches, and Git is unable to automatically merge them. 🔍 When Do Conflicts Happen? Two developers edit the same file Same line is modified in different branches Changes overlap ⚙️ How to Identify Conflict When merging, Git shows: <<<<<<< HEAD Your changes ======= Other branch changes >>>>>>> feature 🛠️ Steps to Resolve Conflict 1️⃣ Open the conflicted file 2️⃣ Identify the conflicting code 3️⃣ Edit and keep the correct version 4️⃣ Remove conflict markers 5️⃣ Add and commit 👉 Commands: git add . git commit -m "resolved conflict" 💡 Best Practices ✔ Pull latest code before starting work ✔ Use small commits ✔ Communicate with team ✔ Avoid editing same file simultaneously 📌 My Learning Today Understanding merge conflicts helped me realize how important collaboration and proper version control are in real-world projects. Resolving conflicts is a key DevOps skill 💪 #Git #MergeConflict #DevOps #VersionControl #CloudComputing #LearningJourney #TechSkills #WomenInTech #CloudEngineer
To view or add a comment, sign in
-
We’re leveraging GitHub Actions to streamline our development workflow and bring consistency to every release. 🔹 Automated triggers on code push & pull requests 🔹 Build and package applications with Maven 🔹 Execute automated testing for quality assurance 🔹 Containerize and deploy using Docker 🔹 Real-time notifications to keep teams aligned This approach enables: ✔ Faster and more reliable deployments ✔ Reduced manual intervention and errors ✔ Improved developer productivity ✔ Consistent delivery across environments By investing in automation, we ensure that our teams focus more on innovation and less on operational overhead. #CICD #DevOps #Automation #SoftwareEngineering #GitHubActions #Docker #Innovation
To view or add a comment, sign in
-
-
GitOps Workflow - Simplified Visual Guide GitOps brought a shift in how software and infrastructure are managed with Git as the central hub for managing and automating the entire lifecycle of applications and infrastructure. It's built on the principles of version control, collaboration, and continuous integration and deployment (CI/CD). Here’s the flow: 1. Developer pushes code to Git 2. CI pipeline (GitHub Actions) runs tests, builds the app, and scans for security issues 3. A Docker image is created and pushed to a registry 4. Deployment configs are updated in a separate Git repository 5. Argo CD detects changes and automatically syncs them 6. Application is deployed to Kubernetes (Dev → Test → Prod) Key takeaway: No manual deployments — just commit changes to Git, and the system handles the rest. This approach improves: - Consistency - Reliability - Faster deployments - Easy rollback using Git history Excited to keep exploring GitOps and cloud-native tools! #GitOps #DevOps #Kubernetes #CloudComputing #CI_CD #ArgoCD #Docker #Automation Image credit: ByteByteGo
To view or add a comment, sign in
-
-
Git Series | Day 9: Optimization & Deployment — Squash, Cherry-Pick, and .gitignore 🚀 As I near the end of this series, I am focusing on the "polishing" tools that professional DevOps Engineers use to ensure their repositories are clean, secure, and ready for production. 1. Squash: Consolidating the Journey Why show 10 "work-in-progress" commits when one clean commit will do? Squash allows me to combine multiple commits into a single, meaningful entry. The Command: git rebase -i HEAD~number The Workflow: In the interactive editor, I keep the first commit as "pick" and change the others to "squash." The Benefit: It keeps the master branch history concise and high-level for senior reviewers. 2. Cherry-Pick: Surgical Precision Sometimes you don't want an entire branch; you just want one specific fix or feature. The Concept: Picking a single commit from one branch and applying it to another. The Command: git cherry-pick <commit-id> The Use Case: Great for pulling a critical hotfix from a development branch directly into production without bringing unfinished features along. 3. .gitignore: The Silent Guardian A professional repository should never contain logs, environment variables, or temporary build files. The Mechanism: By creating a .gitignore file, I tell Git which files to permanently ignore from tracking. Standard Exclusions: I typically exclude *.log, .env (security), and folders like /db or node_modules. The Result: Smaller repository size and zero risk of pushing sensitive credentials to GitHub. 4. Deployment: Hosting via GitHub Pages Git isn't just for tracking; it’s for delivering. I practiced hosting static web applications directly from a repository. Push your code to a new GitHub repository. Navigate to Settings > Pages. Select the master branch and save. Your application is live and accessible via a public URL! My use of .gitignore ensures that sensitive configuration data and "garbage" files never enter the version control system. I Streamline Code Reviews: By squashing messy development commits before merging. #Git #DevOps #100DaysOfCode #WebDeployment #GithubPages #CleanCode #SoftwareEngineering #SysAdmin #GitIgnore
To view or add a comment, sign in
-
-
Why does Git remain the undisputed standard for version control 20 years later? Key Points to Watch: -Distributed Power: Every developer has the entire history, eliminating the "server is down" bottleneck. -Integrity: The use of SHA-1 hashing ensures that what you commit is exactly what gets deployed. -Branching Efficiency: In Git, a branch is just a pointer to a commit, making "feature branching" nearly instant and zero-cost. The Engine of Distributed Truth Headline: Why Git is the "Mission Control" of Modern Engineering Before we had automated pipelines and cloud-native deployments, we had a massive problem: Collaboration at Scale. In 2005, the Linux kernel team faced a crisis that forced a total rethink of how we handle code. The result was Git—a tool built by Linus Torvalds in just two weeks that fundamentally changed how the world builds software. The "Architect" View on Git: -Zero Single Point of Failure: Unlike older centralized systems (SVN/CVS), Git is distributed. Every clone is a full backup. If the main server goes dark, the project lives on every engineer's machine. -Immutable History: Every commit is cryptographically hashed. In a DevOps pipeline, this is your "Chain of Custody"—you know exactly which lines of code triggered which deployment. -Branching as a Strategy: Git made branching "cheap." This allowed us to move away from "all hands on one file" to isolated feature development, which is the heartbeat of CI/CD. Whether I'm managing a complex GitHub Enterprise migration or spinning up a new microservice, Git isn't just a "save button." It is the source of truth that triggers the entire automation lifecycle. Quick Poll for the Devs: When you're in the terminal, are you a git rebase perfectionist or a git merge traditionalist? #Git #DevOps #VersionControl #OpenSource #SoftwareArchitecture #CloudEngineering #GitHub #TechHistory #7EagleGroup #7EagleAcademy Jordie Kern , Adam Peters, Brad Lawson, M.S., Donavan Maldonado-Fashina
To view or add a comment, sign in
-
-
🚀 DevOps Journey – Day 16 / 100 Today I explored Git Merge vs Rebase, Stash & GitHub basics 🔥 🔹 🔁 Merge vs Rebase (Interview Perspective) ✅ Git Merge • Combines branches with a merge commit • Preserves full history • Best for team collaboration ✅ Git Rebase • Rewrites commit history linearly • Cleaner & readable history • Best for local development 💡 Difference in One Line: 👉 Merge = Safe & history preserved 👉 Rebase = Clean & linear history ⸻ 🔹 📦 Git Stash (Temporary Save) • git stash → Save uncommitted changes • git stash list → View stash list • git stash apply → Reapply changes • git stash clear → Delete all stash ⸻ 🔹 🌐 GitHub Basics • Create account on GitHub • Create a repository • Default branch = main 🔹 🔗 Connect Local to GitHub • git remote add origin <URL> • git remote -v → Verify remote ⸻ 🔹 🚀 Push Code • git push origin branch • git push origin --all 💡 Note: Using HTTPS → Requires username + personal access token (PAT) instead of password ⸻ 🔥 Pro Tip: Use Merge in real projects, Rebase for clean commits before pushing! Consistency + Practice = DevOps Success 💪 #DevOps #Git #GitHub #Linux #VersionControl #100DaysOfDevOps #LearningJourney #Cloud #Automation #selflearning #devops #software
To view or add a comment, sign in
-
Explore related topics
- Key Skills for a DEVOPS Career
- How to Use Git for IT Professionals
- Best Practices for Merging Code in Teams
- DevOps Principles and Practices
- DevOps Engineer Core Skills Guide
- How to Handle Conflicts During Project Negotiations
- Tips for Continuous Improvement in DevOps Practices
- How to Resolve Conflicts in Agile Teams
- Tips for Resolving Collaboration Conflicts
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