子模块允许你将一个 Git 仓库作为另一个 Git 仓库的子目录。 它能让你将另一个仓库克隆到自己的项目中,同时还保持提交的独立
$ git submodule add --name DbConnector https://github.com/chaconinc/DbConnector DbConnector
$ git clone https://github.com/chaconinc/MainProject
$ cd MainProject
$ git submodule init
$ git submodule update
$ git clone --recursive https://github.com/chaconinc/MainProject
$ git submodule update --remote
git submodule deinit -f -- a/submodule
rm -rf .git/modules/a/submodule
git rm -rf a/submodule
# Note: a/submodule (no trailing slash)
# or, if you want to leave it in your working tree
git rm --cached a/submodule
git submodule add --name RSKImageCropper https://github.com/shimo-react-native/RSKImageCropper.git ios/RSKImageCropper
git submodule deinit -f -- ios/RSKImageCropper
rm -rf .git/modules/ios/RSKImageCropper
git rm -rf ios/RSKImageCropper
git rm --cached ios/RSKImageCropper