2014-10-31 110 views
0

我有一個項目main和小型項目small。 爲了使smallmain一個子模塊,我已經做了這樣的:克隆主存儲庫時未克隆子模塊

cd main_project 
git submodule add [email protected]:ironsand/small.git small 
git add .gitmobules 
git commit -m "add submodule small" 
git push 

而在其他目錄中我跑git clone [email protected]:ironsand/main.git,但small子目錄是空的。

這是我第一次使用submodule功能git,所以可能我做錯了什麼。你可以告訴我克隆主存儲庫時克隆子模塊嗎?

回答

1

在做克隆,克隆子模塊以及

git clone --recursive [email protected]:ironsand/main.git 
recursive克隆