{ "id": "git-diverged-branches-mcq", "title": "Your Branch and the Remote Have Diverged", "category": "Git", "isolation_type": "shared_namespace", "difficulty": "Medium", "type": "mcq", "weight": 4, "description": "## Your Branch and the Remote Have Diverged\n\n`git status` reports \"Your branch and 'origin/main' have diverged, and have 2 and 3 different commits each, respectively.\" What should you understand BEFORE blindly running `git pull`?", "options": [ { "id": "a", "text": "Nothing — git pull always resolves this automatically and safely with no side effects" }, { "id": "b", "text": "That a pull here will attempt to merge (or rebase, depending on config) the remote's 3 commits with your own 2 local commits, which can itself produce a conflict you'll need to resolve — the same way two diverged branches did in this course's merge exercise" }, { "id": "c", "text": "That you must delete your local commits first" }, { "id": "d", "text": "That the remote repository is corrupted" } ], "correct_option": "b", "explanation": "\"Diverged\" means both sides have commits the other doesn't have — a plain `git pull` is really fetch-then-merge (or rebase), and merging two sets of independent commits can conflict exactly like the local branch-merge exercise did, just with a remote branch instead of a local one. Understanding this before pulling means you won't be surprised by a conflict, and you definitely don't need to delete anything or assume corruption.", "hints": [], "setup_commands": [], "default_namespace": "default", "teardown_commands": [] }