I have a 2 GitHub repos and one of the is included into the other as a submodule. When I call git pull --recurse-submodules, I get the version of the submodule, that is no more the current one (not from the last commit, but from one of the older). When I run git submodule update --recursive --remote, I get the current version. What is happening here and how do I make the first command to pull the current submodule version?
            Asked
            
        
        
            Active
            
        
            Viewed 19 times
        
    -1
            
            
         
    
    
        Roman Reimche
        
- 143
- 1
- 13
- 
                    https://stackoverflow.com/a/1778247/7976758 "*…submodules are not on a branch. They are … just a pointer to a particular commit…*" I.e., the superproject stores (in every commit) the state (commit ID) of every submodule. https://stackoverflow.com/a/55570998/7976758 "*Every commit of a repo is a snapshot/state of your code at that time. The state of submodule at that time has to be deterministic too.*" – phd Jul 12 '23 at 12:09
- 
                    1BTW after you did `git submodule update --recursive --remote` you should return to the superproject directory and commit the change in the submodule: `git add&& git commit -m "Update – phd Jul 12 '23 at 12:09"` 
1 Answers
0
            
            
        As phd point in comments to the question: "after you did git submodule update --recursive --remote you should return to the superproject directory and commit the change in the submodule: git add <submodule> && git commit -m "Update <submodule>""
 
    
    
        Roman Reimche
        
- 143
- 1
- 13