git Submodule
是一個(gè)很好的多項(xiàng)目使用共同類庫的工具耸峭。
添加子模塊
// 以AFNetworking為例,https://github.com/AFNetworking/AFNetworking.git克隆到Libraries/AFNetworking文件夾
git submodule add https://github.com/AFNetworking/AFNetworking.git Libraries/AFNetworking
更新子模塊
// 更新項(xiàng)目內(nèi)子模塊到最新版
git submodule update
// 更新子模塊為遠(yuǎn)程項(xiàng)目的最新版本
git submodule update --remote
刪除子模塊
1. git submodule deinit -f -- Libraries/AFNetworking
2. rm -rf .git/modules/Libraries/AFNetworking
3. git rm -f Libraried/AFNetworking