आप यह topic देख सकते हैं।
मैं GIT का उपयोग नहीं करते, लेकिन अगर आप .gitmodules फ़ाइलों का पता कर सकते हैं, यह प्रत्येक submodules के लिए पाश करने के लिए आसान हो सकता है:
<command to find all of your submodules>|while read; do
# ... (default use $REPLY as an item)
done
या:
while read; do
# ...
done <<< "$(command to find all of your submodules)"
इस reminder on how to read a command output with a loop in Bash देखें । bash
में help :
से
foreach
Evaluates an arbitrary shell command in each checked out submodule.
The command has access to the variables $name, $path, $sha1 and
$toplevel: $name is the name of the relevant submodule section in
.gitmodules, $path is the name of the submodule directory relative
to the superproject, $sha1 is the commit as recorded in the
superproject, and $toplevel is the absolute path to the top-level
of the superproject. Any submodules defined in the superproject but
not checked out are ignored by this command. Unless given --quiet,
foreach prints the name of each submodule before evaluating the
command. If --recursive is given, submodules are traversed
recursively (i.e. the given shell command is evaluated in nested
submodules as well). A non-zero return from the command in any
submodule causes the processing to terminate. This can be
overridden by adding || : to the end of the command.
As an example, git submodule foreach 'echo $path `git rev-parse
HEAD`' will show the path and currently checked out commit for each
submodule.
आदेश :
:
git submodule foreach 'npm install || :'
यह मैनुअल से लिया जाता है: git help submodule
स्रोत
2013-11-01 14:48:26
Git submodule foreach 'सूत' – danday74