你必須運行:
git submodule init
git submodule update
-
您需要在根.gitmodules文件F0的樹,它看起來像這樣。
[submodule "LiveReload/Compilers"]
path = LiveReload/Compilers
url = git://github.com/livereload/livereload-plugins.git
[submodule "Shared/libs/fsmonitor"]
path = Shared/libs/fsmonitor
url = git://github.com/andreyvit/fsmonitor.c.git
[submodule "js"]
path = js
url = git://github.com/livereload/livereload-js.git
這裏的輸出應該如何看待基於以上:
Nicks-MacBook:LiveReload2 admin$ git submodule init
Submodule 'LiveReload/Compilers' (git://github.com/livereload/livereload-plugins.git) registered for path 'LiveReload/Compilers'
Submodule 'Shared/libs/fsmonitor' (git://github.com/andreyvit/fsmonitor.c.git) registered for path 'Shared/libs/fsmonitor'
Submodule 'js' (git://github.com/livereload/livereload-js.git) registered for path 'js'
Nicks-MacBook:LiveReload2 admin$ git submodule update
Cloning into 'LiveReload/Compilers'...
remote: Counting objects: 7571, done.
remote: Compressing objects: 100% (5446/5446), done.
remote: Total 7571 (delta 2326), reused 6733 (delta 1488)
Receiving objects: 100% (7571/7571), 7.80 MiB | 2.73 MiB/s, done.
Resolving deltas: 100% (2326/2326), done.
Submodule path 'LiveReload/Compilers': checked out 'd770710edc2362caf4ed9adf303da1edc9e6e494'
Cloning into 'Shared/libs/fsmonitor'...
remote: Counting objects: 132, done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 132 (delta 73), reused 112 (delta 53)
Receiving objects: 100% (132/132), 23.29 KiB, done.
Resolving deltas: 100% (73/73), done.
Submodule path 'Shared/libs/fsmonitor': checked out '1290027aea3a8e3f7fe06e3c228a16240c0fc17f'
Cloning into 'js'...
remote: Counting objects: 745, done.
remote: Compressing objects: 100% (413/413), done.
remote: Total 745 (delta 301), reused 703 (delta 259)
Receiving objects: 100% (745/745), 864.22 KiB | 820 KiB/s, done.
Resolving deltas: 100% (301/301), done.
Submodule path 'js': checked out '6aa86b01479c3aad785e9623f39cfcde2b8615f
確定這肯定工作...所以當它是適合使用的foreach COMAND? – 2012-01-09 08:52:22
@PrimozRome:對於你想在每個子模塊上使用的任何命令,就像在這個外部腳本示例中一樣:http://stackoverflow.com/questions/5889246/git-submodule-foreach-execute-read – VonC 2012-01-09 09:23:31