Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: Changing branches in supermodule does not affect submodule?

From: Peter Krefting <hidden>
Date: 2016-06-15 22:47:33

Jens Lehmann:
just calling "git submodule update" every time you want the submodule to 
be updated according to the state committed in the superproject will do 
the trick (but keep in mind that all referenced commits have to be 
accessible in the local clone of your submodule, so you might have to do a 
fetch there once in a while).
Is it possible to automate this from a hook or something else? Basically, I 
would like it to update all the submodules to the state recorded in the 
commit I move to, if they were in a clean state before I moved. I do not 
want it to change states if I do something like

   cd submodule
   # do some changes
   git commit
   cd ..
   git checkout -b newbranch

because there I want the commit I made to the submodule to be recorded on 
the new branch I created. But then it was in a dirty state before I created 
the branch anyway, so that shouldn't be a problem.

-- 
\\// Peter - http://www.softwolves.pp.se/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help