[TYPO3-dev] GIT rebase question with submodules

Peter Niederlag typo3-list at niekom.de
Fri Sep 16 14:16:05 CEST 2011


Hello,

Am 16.09.2011 10:33, schrieb Stefan Geith:
> Am 16.09.2011 09:53, schrieb Peter Niederlag:
[...]
> So for updates, I have to pull master, then rebase my local branch with
> these steps:
> 
> 1. cd [path_of_local_master] OR git checkout master
> 2. git pull
> 3. git submodule update --init
> 4. cd [path_to'my_personal_version] OR git checkout my_t3_version
> 
> right so far ?

I guess the "cd" is for having two separate working dirs? Yes...

> Then I want to rebase... what is the next step
> *IF* I have changed  something in the submodules ?
>    a. git rebase master
> or
>    b. git submodule foreach git rebase master

In general a) and b) are be required, as you (might) want to rebase both
the superproject and the submodules.

I guess problems still depend on wether you have commited/updated the
submodule pointers, which I would suggest NOT to do. You can cd into a
submodule and commit/create/checkout branches as you like but you should
NOT 'git commit path/submodule' in the superproject (update submodule
pointer).

And it gets REALLY BAD if you use command completion and do a 'git
commit path/submodule/' in the superproject, which is a very nasty
pitfall (note the slash in the end)!  In effect this does remove the
submodule and add the contents of the submodule to the superproject.
Then you are in trouble and have some extra workload to handle! ;(

Could this have happened to you?

Greets and hth,
Peter
-- 
Peter Niederlag
http://www.niekom.de * TYPO3 & EDV Dienstleistungen *




More information about the TYPO3-dev mailing list