git Submodule

git Submodule 是一个很好的多项目使用共同类库的工具。

添加子模块

// 以AFNetworking为例,https://github.com/AFNetworking/AFNetworking.git克隆到Libraries/AFNetworking文件夹
git submodule add https://github.com/AFNetworking/AFNetworking.git Libraries/AFNetworking

更新子模块

// 更新项目内子模块到最新版
git submodule update
// 更新子模块为远程项目的最新版本
git submodule update --remote

删除子模块

1. git submodule deinit -f -- Libraries/AFNetworking
2. rm -rf .git/modules/Libraries/AFNetworking
3. git rm -f Libraried/AFNetworking
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容