Include submodules as well in git checkout-index
Asked Answered
A

2

9

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

Arytenoid answered 12/7, 2014 at 7:33 Comment(2)
I don't believe git checkout-index is submodule-aware. Can you use git submodule foreach to help you though?Burley
It seems that it might be the only option.Arytenoid
T
4

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'
Tertia answered 11/10, 2018 at 4:20 Comment(0)
P
0

You may want to try:

#install submodules
git submodule update --init --recursive

The recursive flag is not required but, per the man page:

If --recursive is specified, this command will recurse into the registered submodules, and update any nested submodules within.
Pokelogan answered 16/10, 2018 at 21:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.