2011-07-05 31 views
6

file .gitmodule có danh sách các url submodule và đường dẫn, tương tự như saugit add từ xa trong submodule

[submodule ".vim/bundle/subRepo"] 
    path = .vim/bundle/subRepo 
    url = https://git.com/sub/repo 

và trong .git/config của repo lõi có danh sách các điều khiển từ xa

[remote "origin"] 
    fetch = +refs/heads/*:refs/remotes/origin/* 
    url = [email protected] 

khi

git submodule init 
git submodule update 

Tôi nhận được mô-đun con.

cách thêm một lần danh sách điều khiển từ xa trong mô-đun con? vì đã không viết mọi

git remote add remoteAlias git://... 

trong mỗi submodule

Trả lời

2
git clone --recursive 

hoặc

git submodule update --init --recursive 

nếu bạn đã nhân bản vô tính.

+1

nhưng, "git submodule cập nhật --init --recursive" là dành cho kéo đệ quy? – JuanPablo

+0

không. khi bạn kéo, bạn chỉ hành động trên kho lưu trữ đó. Hãy thử 'git submodule foreach --recitive git pull --rebase'. Việc rebase là tùy chọn. –