On Sunday, 27 July 2014 18:00:51 UTC+2, Philipp Kraus wrote:
>
> Hello,
>
> I have got a large project and configure some Git submodules and include 
> them into the main project:
>
> mainproject
> |----submodul 1
> |----submodul 2
> ....
>
> The submodule are based on a unique commit (hash). My question is, can I 
> clone the main
> project recursive with the submodules and push changes on the submodul 
> into the submodul repo and
> update the commit hash in the main project in one shot?
>
> In short:
>
> git clone --recursive myproject
> cd mainproject
> cd submodul1
> touch test.txt
> git add .
> git commit
> git push
>
> so the test.txt file will be commited and pushed into the submodul1
>
> Thanks a lot
>
> Phil
>

I don't see any other option than chaining your commands by joining them 
with *&&* (or *;* if you want each command to be executed even if one of 
them fails, but I doubt it).

$ git clone --recursive myproject && cd mainproject/submodule1 && touch 
test.txt && git add test.txt && git commit && git push

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to