情形一:首次克隆
git clone --recurse-submodules git@github.com:FreeRTOS/FreeRTOS.git
该命令会递归克隆该仓库及所有的子模块。
工程目录下的.gitmodules文件内容如下:
[submodule "FreeRTOS/Source"]
path = FreeRTOS/Source
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
[submodule "FreeRTOS/Test/CMock/CMock"]
path = FreeRTOS/Test/CMock/CMock
url = https://github.com/ThrowTheSwitch/CMock.git
[submodule "FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP"]
path = FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP
url = https://github.com/FreeRTOS/FreeRTOS-Plus-TCP
[submodule "FreeRTOS-Plus/Source/AWS/device-shadow"]
path = FreeRTOS-Plus/Source/AWS/device-shadow
url = https://github.com/aws/device-shadow-for-aws-iot-embedded-sdk
[submodule "FreeRTOS-Plus/Source/Application-Protocols/coreMQTT"]
path = FreeRTOS-Plus/Source/Application-Protocols/coreMQTT
url = https://github.com/FreeRTOS/coreMQTT
[submodule "FreeRTOS-Plus/Source/coreJSON"]
path = FreeRTOS-Plus/Source/coreJSON
url = https://github.com/FreeRTOS/coreJSON
[submodule "FreeRTOS-Plus/Test/CMock"]
path = FreeRTOS-Plus/Test/CMock
url = https://github.com/ThrowTheSwitch/CMock
[submodule "FreeRTOS-Plus/ThirdParty/mbedtls"]
path = FreeRTOS-Plus/ThirdParty/mbedtls
url = https://github.com/Mbed-TLS/mbedtls.git
[submodule "FreeRTOS-Plus/Source/Application-Protocols/corePKCS11"]
path = FreeRTOS-Plus/Source/corePKCS11
url = https://github.com/FreeRTOS/corePKCS11.git
[submodule "FreeRTOS-Plus/Source/AWS/jobs"]
path = FreeRTOS-Plus/Source/AWS/jobs
url = https://github.com/aws/jobs-for-aws-iot-embedded-sdk.git
[submodule "FreeRTOS-Plus/Source/AWS/device-defender"]
path = FreeRTOS-Plus/Source/AWS/device-defender
url = https://github.com/aws/device-defender-for-aws-iot-embedded-sdk.git
[submodule "FreeRTOS-Plus/Source/Application-Protocols/coreHTTP"]
path = FreeRTOS-Plus/Source/Application-Protocols/coreHTTP
url = https://github.com/FreeRTOS/coreHTTP
[submodule "FreeRTOS-Plus/Source/Utilities/backoff_algorithm"]
path = FreeRTOS-Plus/Source/Utilities/backoff_algorithm
url = https://github.com/FreeRTOS/backoffAlgorithm.git
[submodule "FreeRTOS-Plus/ThirdParty/wolfSSL"]
path = FreeRTOS-Plus/ThirdParty/wolfSSL
url = https://github.com/wolfSSL/wolfssl.git
[submodule "FreeRTOS-Plus/Source/Application-Protocols/coreMQTT-Agent"]
path = FreeRTOS-Plus/Source/Application-Protocols/coreMQTT-Agent
url = https://github.com/FreeRTOS/coreMQTT-Agent.git
[submodule "FreeRTOS-Plus/Source/AWS/ota"]
path = FreeRTOS-Plus/Source/AWS/ota
url = https://github.com/aws/ota-for-aws-iot-embedded-sdk.git
[submodule "FreeRTOS-Plus/Source/Application-Protocols/coreSNTP"]
path = FreeRTOS-Plus/Source/Application-Protocols/coreSNTP
url = https://github.com/FreeRTOS/coreSNTP.git
[submodule "FreeRTOS/Demo/ThirdParty/Community-Supported-Demos"]
path = FreeRTOS/Demo/ThirdParty/Community-Supported-Demos
url = https://github.com/FreeRTOS/FreeRTOS-Community-Supported-Demos
[submodule "FreeRTOS/Demo/ThirdParty/Partner-Supported-Demos"]
path = FreeRTOS/Demo/ThirdParty/Partner-Supported-Demos
url = https://github.com/FreeRTOS/FreeRTOS-Partner-Supported-Demos
[submodule "FreeRTOS-Plus/Source/AWS/sigv4"]
path = FreeRTOS-Plus/Source/AWS/sigv4
url = https://github.com/aws/SigV4-for-AWS-IoT-embedded-sdk.git
[submodule "FreeRTOS-Plus/Source/FreeRTOS-Cellular-Interface"]
path = FreeRTOS-Plus/Source/FreeRTOS-Cellular-Interface
url = https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface.git
[submodule "FreeRTOS-Plus/ThirdParty/tinycbor"]
path = FreeRTOS-Plus/ThirdParty/tinycbor
url = https://github.com/intel/tinycbor.git
[submodule "FreeRTOS-Plus/Source/AWS/fleet-provisioning"]
path = FreeRTOS-Plus/Source/AWS/fleet-provisioning
url = https://github.com/aws/Fleet-Provisioning-for-AWS-IoT-embedded-sdk.git
[submodule "FreeRTOS-Plus/Source/FreeRTOS-Cellular-Modules/bg96"]
path = FreeRTOS-Plus/Source/FreeRTOS-Cellular-Modules/bg96
url = https://github.com/FreeRTOS/Lab-FreeRTOS-Cellular-Interface-Reference-Quectel-BG96.git
[submodule "FreeRTOS-Plus/Source/FreeRTOS-Cellular-Modules/hl7802"]
path = FreeRTOS-Plus/Source/FreeRTOS-Cellular-Modules/hl7802
url = https://github.com/FreeRTOS/Lab-FreeRTOS-Cellular-Interface-Reference-Sierra-Wireless-HL7802.git
[submodule "FreeRTOS-Plus/Source/FreeRTOS-Cellular-Modules/sara-r4"]
path = FreeRTOS-Plus/Source/FreeRTOS-Cellular-Modules/sara-r4
url = https://github.com/FreeRTOS/Lab-FreeRTOS-Cellular-Interface-Reference-ublox-SARA-R4.git
情形二:已经克隆该仓库,但是没有克隆子模块
git submodule update --init --recursive
如果您已经克隆了没有子模块的存储库,则可以使用以下命令获取子模块。
特殊的,如果仅仅想克隆部分自己需要的子模块,可以在工程目录下的.gitmodules文件中指定。
另外,将HTTP地址换成SSH下载速度更快。
[submodule "FreeRTOS/Source"]
path = FreeRTOS/Source
url = git@github.com:TigerPiger/FreeRTOS-Kernel.git
[submodule "FreeRTOS/Test/CMock/CMock"]
path = FreeRTOS/Test/CMock/CMock
url = git@github.com:ThrowTheSwitch/CMock.git
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)