Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 2 MCQs Version Control & Source Code Management

INT331 — Fundamentals Of Devops 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Why Version Control? Easy

    What is the primary purpose of a version control system (VCS)?

  2. Question 2 of 60 Why Version Control? Easy

    Which of the following is a key benefit of using version control in software teams?

  3. Question 3 of 60 Git Repositories Easy

    In Git, what is a repository?

  4. Question 4 of 60 Git Repositories Easy

    Which hidden folder does Git create to store repository metadata?

  5. Question 5 of 60 Git Cmd/Bash: Git basic operations (add, init, push, pull) Easy

    Which command creates a new empty Git repository in the current directory?

  6. Question 6 of 60 Git Cmd/Bash: Git basic operations (add, init, push, pull) Easy

    What does the git add command do?

  7. Question 7 of 60 Git Cmd/Bash: Git basic operations (add, init, push, pull) Easy

    Which command uploads your local commits to a remote repository?

  8. Question 8 of 60 Git Cmd/Bash: Git basic operations (add, init, push, pull) Easy

    What does the git pull command do?

  9. Question 9 of 60 Commits Easy

    What does a Git commit represent?

  10. Question 10 of 60 Commits Easy

    Which command is used to record staged changes with a message?

  11. Question 11 of 60 Branching Easy

    What is a branch in Git?

  12. Question 12 of 60 Branching Easy

    Which command creates a new branch and switches to it in one step?

  13. Question 13 of 60 Merging Easy

    What does merging accomplish in Git?

  14. Question 14 of 60 tagging Easy

    What is a Git tag commonly used for?

  15. Question 15 of 60 rebasing Easy

    What is the main purpose of git rebase?

  16. Question 16 of 60 stashing Easy

    What does git stash do?

  17. Question 17 of 60 Git Remote Workflows: GitHub Flow, Feature Branch Workflow Easy

    In the Feature Branch Workflow, where is new work typically developed?

  18. Question 18 of 60 Git Remote Workflows: GitHub Flow, Feature Branch Workflow Easy

    In GitHub Flow, what is typically opened to propose merging a branch into main?

  19. Question 19 of 60 Resolving Merge Conflicts Easy

    When does a merge conflict typically occur in Git?

  20. Question 20 of 60 GitHub: Issues, Pull Requests, Discussions Easy

    On GitHub, what are Issues primarily used for?

  21. Question 21 of 60 Why Version Control? Medium

    A team of five developers is working on the same codebase without any version control system. Which problem are they most likely to encounter first?

  22. Question 22 of 60 Git Repositories Medium

    You run git init inside an existing project folder. What is created as a result?

  23. Question 23 of 60 Git Cmd/Bash: Git basic operations (add, init, push, pull) Medium

    After editing app.js, you run git commit -m "fix" but Git reports nothing to commit. What did you most likely forget?

  24. Question 24 of 60 Git Cmd/Bash: Git basic operations (add, init, push, pull) Medium

    Your local branch is behind the remote. Which command updates your local branch by fetching and integrating remote changes in one step?

  25. Question 25 of 60 Commits Medium

    What does the SHA-1 hash associated with a Git commit primarily represent?

  26. Question 26 of 60 Commits Medium

    You committed with the wrong message and have not pushed yet. Which command lets you correct only the message of the most recent commit?

  27. Question 27 of 60 Branching Medium

    Which single command creates a new branch called feature and switches to it immediately?

  28. Question 28 of 60 Branching Medium

    In Git, what does a branch fundamentally point to?

  29. Question 29 of 60 Merging Medium

    You merge feature into main, and main had no new commits since feature diverged. What type of merge does Git perform by default?

  30. Question 30 of 60 Merging Medium

    When Git creates a merge commit during a three-way merge, how many parent commits does that merge commit have?

  31. Question 31 of 60 tagging Medium

    Your team wants to mark commit v1.0 with a tag that stores the tagger name, date, and a message. Which command creates such an annotated tag?

  32. Question 32 of 60 rebasing Medium

    What is the primary effect of running git rebase main while on your feature branch?

  33. Question 33 of 60 rebasing Medium

    Why is it generally discouraged to rebase commits that have already been pushed to a shared remote branch?

  34. Question 34 of 60 stashing Medium

    You have uncommitted changes but must quickly switch branches to fix a bug. Which command temporarily saves your work and cleans the working directory?

  35. Question 35 of 60 stashing Medium

    After stashing changes, which command reapplies the most recent stash and removes it from the stash list?

  36. Question 36 of 60 Git Remote Workflows: GitHub Flow Medium

    In GitHub Flow, what is the recommended way to introduce a new feature into the main branch?

  37. Question 37 of 60 Feature Branch Workflow Medium

    In the Feature Branch Workflow, what is the main purpose of keeping each feature on its own branch?

  38. Question 38 of 60 Resolving Merge Conflicts Medium

    While merging, Git inserts markers like <<<<<<<, =======, and >>>>>>> into a file. What must you do to complete the merge?

  39. Question 39 of 60 GitHub: Issues Medium

    On GitHub, which feature is best suited for tracking a reported bug and discussing how to fix it before any code is written?

  40. Question 40 of 60 Pull Requests Medium

    In a GitHub pull request, what does linking it to an issue with a keyword like Closes #42 accomplish?

  41. Question 41 of 60 Git Cmd/Bash: Git basic operations (add, init, push, pull) Hard

    You run git init in a directory that is already inside an existing Git repository's working tree (a subfolder). What is the actual effect?

  42. Question 42 of 60 Commits Hard

    A commit C has SHA abc123. You amend it with git commit --amend without changing anything except the author date. Which statement is true about the resulting commit?

  43. Question 43 of 60 rebasing Hard

    You rebase your feature branch onto main with git rebase main. Midway a conflict appears. After editing files and running git add, which command correctly continues the rebase?

  44. Question 44 of 60 Merging Hard

    Branch feature and main have diverged. You run git merge feature on main and Git performs a fast-forward. What must have been true?

  45. Question 45 of 60 stashing Hard

    You have staged changes to a.txt and unstaged changes to b.txt. You run git stash push, then later git stash pop. By default, what is the state of the staging area after popping?

  46. Question 46 of 60 tagging Hard

    What is the key structural difference between a lightweight tag and an annotated tag in Git?

  47. Question 47 of 60 Resolving Merge Conflicts Hard

    During a conflict, you see markers <<<<<<< HEAD, =======, and >>>>>>> feature. Which section sits between <<<<<<< HEAD and =======?

  48. Question 48 of 60 rebasing Hard

    Why is rebasing a branch that has already been pushed and pulled by collaborators considered dangerous?

  49. Question 49 of 60 Git Remote Workflows: GitHub Flow Hard

    In GitHub Flow, which sequence best reflects the intended workflow?

  50. Question 50 of 60 Branching Hard

    You create a branch with git branch feature but keep committing. Later you notice your new commits landed on main instead of feature. Why?

  51. Question 51 of 60 Git Repositories Hard

    What does the term "bare repository" refer to in Git, and why is it used for remotes?

  52. Question 52 of 60 Git Cmd/Bash: Git basic operations (add, init, push, pull) Hard

    git pull is conceptually equivalent to which combination of operations by default?

  53. Question 53 of 60 Merging Hard

    What distinguishes a "recursive" (or "ort") merge from an "octopus" merge in Git?

  54. Question 54 of 60 GitHub: Issues, Pull Requests, Discussions Hard

    In a GitHub pull request description, you write "Closes #42". What happens when the PR is merged into the default branch?

  55. Question 55 of 60 stashing Hard

    By default, git stash does NOT stash which category of files?

  56. Question 56 of 60 Git Remote Workflows: Feature Branch Workflow Hard

    In the Feature Branch Workflow, why should feature branches be kept short-lived and frequently synced with the integration branch?

  57. Question 57 of 60 rebasing Hard

    During an interactive rebase (git rebase -i), you want to combine a commit into the previous one while discarding the combined commit's message. Which action word should you use?

  58. Question 58 of 60 Commits Hard

    You accidentally committed a large secret file, then made 5 more commits. To completely remove that file from all of history (not just the latest commit), which is the appropriate approach?

  59. Question 59 of 60 Why Version Control? Hard

    Which scenario most directly demonstrates a capability that distributed version control (like Git) provides but a purely centralized system (like classic CVS/SVN) does not?

  60. Question 60 of 60 Resolving Merge Conflicts Hard

    After a botched conflict resolution during git merge, you want to abandon the merge and return the working tree to the exact state before you started. Which command does this?

That's unit 2

Answer a few questions and your score shows up here.