Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include submodules as well in git checkout-index

Is there a way to copy files from the submodules as well when doing git checkout-index?

I already checked the documentation of git checkout-index but it makes no mention of submodules

like image 515
Sudar Avatar asked Jul 12 '14 07:07

Sudar


1 Answers

Neither checkout-index.c, t/t2006-checkout-index-basic.sh nor Documentation/git-checkout-index.txt mention submodules.
That was confirmed/discussed in this issue (2010) or this one (2015-2016).

So (as commented) git submodule foreach remains the best option:

 git submodule foreach --recursive 'git checkout-index'
like image 128
VonC Avatar answered Sep 17 '22 13:09

VonC