Beginner LevelGit & GitHub
What causes Git Merge Conflicts and how do you manually resolve them?
❓ Interview Prompt: Explain the causes of merge conflicts, interpreting conflict markers (<<<<<<<, =======, >>>>>>>), resolving files, and completing merges.
Merge conflicts occur when Git attempts to merge two branches that modified the exact same line of a file differently. Resolving requires editing conflict markers (<<<<<<<, =======, >>>>>>>), staging files via git add <file>, and running git commit.
Code Implementation Example
javascript
// Conflict Markers:
<<<<<<< HEAD
const apiEndpoint = "https://api.v2.myapp.com";
=======
const apiEndpoint = "https://api.staging.myapp.com";
>>>>>>> feature/staging-config
// Resolved:
const apiEndpoint = "https://api.v2.myapp.com";💡Resolving Git merge conflict markers in source code files.
🎯 Interview Key Takeaway
Resolve merge conflicts by editing conflict markers (<<<<<<<, =======, >>>>>>>), staging resolved files with git add, and running git commit.
#Merge Conflicts#git merge#Beginner
Back to all Git & GitHub Questions→