Missing git command when checking out projects with submodule

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: High
    • None
    • Affects Version/s: 1.8.2.3
    • Component/s: General, Git
    • None
    • Severity 1 - Critical

      I have a repo with many submodules
      The git command sequence for checkout operation is missing a fundamental step.
      1) git submodule deinit .
      2) git checkout ...
      3) git submodule update --init --recursive
      Essentially the (2) and (3) are covered, but (1) is missing at all

      Copy/Paste from SourceTree
      "
      git -c diff.mnemonicprefix=false -c core.quotepath=false checkout event-w-obj_ptr
      Switched to branch 'event-w-obj_ptr'

      git -c diff.mnemonicprefix=false -c core.quotepath=false submodule update --init --recursive
      Completed successfully.
      "

      Pretend you are on master with 3 submodules: alpha, beta, gamma
      Now checkout a commit that does not contain beta and gamma (could be a previous step in project development)
      The result of not running (1) is that the 2 directories with beta and gamma are left on the file-system causing confusion!

      This behaviour applies on branch switching too.

      I'm not 100% sure 'cause I didn't test all possibilities, but I think you need to "git submodule deinit ." before any checkout operation.

      This is a long standing issue affecting also previous versions

            Assignee:
            Unassigned
            Reporter:
            Fabrizio Da Ros
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: