If I have a git project Consumer with a git submodule repo called Producer, is there any way to keep the commit history from the submodule (Producer) seperate from the containing git repo (Consumer)?
            Asked
            
        
        
            Active
            
        
            Viewed 51 times
        
    1 Answers
1
            
            
        By definition, a submodule allows you to keep it separate from its parent repo.
Consumer would record a gitlink (special entry in its index) to Producer, that is a fixed SHA1.
Even if you instruct that submodule to "follow" a branch, a checkout of Consumer will not immediately update Producer (a separate  git submodule update --remote is needed)
A submodule is there to allow a repo to reference another repo at a fixed point in the submodule repo history (see "true nature of submodules")
 
     
    