简体   繁体   English

git 在子模块中添加遥控器

[英]git add remote in submodule

the.gitmodule file have the list of submodule url and path, similar to this .gitmodule 文件有子模块列表 url 和路径,类似于这个

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

and in the.git/config of core repo have list of remotes并且在核心 repo 的 .git/config 中有遥控器列表

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@otherRepo.com

when什么时候

 git submodule init
 git submodule update

I get the submodules.我得到了子模块。

how add one time the list of remotes in a submodule?如何在子模块中添加一次遥控器列表? for not write everytime因为不是每次都写

git remote add remoteAlias git://... 

in each submodule在每个子模块中

git clone --recursive

or或者

git submodule update --init --recursive

if you already cloned.如果你已经克隆了。

I begin this command我开始这个命令

https://github.com/juanpabloaj/git-remote-init https://github.com/juanpabloaj/git-remote-init

for save the remotes in a.gitremotes file将遥控器保存在 a.gitremotes 文件中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM