CS FundamentalsHardProduct-company placement · Git

How many of these statements about Git submodules are correct? 1. A plain git clone of the superproject leaves submodule directories empty until git submodule update --init is run (or --recurse-submodules is used). 2. The superproject records a specific commit of each submodule, not a branch to follow. 3. Committing in the submodule automatically updates the superproject's pointer. 4. After pulling a superproject commit that moves a submodule pointer, git submodule update checks out that commit in the submodule.

  1. A. 1
  2. B. 2
  3. C. 4
  4. D. 3

Correct answer: D. 3

1, 2 and 4 are correct: the superproject stores a gitlink to an exact commit. After committing inside a submodule you must still stage and commit the new pointer in the superproject, so 3 is false.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic