git submodule add
して、ライブラリを導入したい。が、以前1度登録して削除なんてことをやっていると(なかなかやらないだろうけど)gitに怒られる。
例えばプロジェクトディレクトリで Alamofireを取得する場合。
git submodule add https://github.com/Alamofire/Alamofire.git
しかし1度登録したことがあるライブラリだと、
A git directory for 'Alamofire' is found locally with remote(s):
origin https://github.com/Alamofire/Alamofire.git
If you want to reuse this local git directory instead of cloning again from
https://github.com/Alamofire/Alamofire.git
use the '--force' option. If the local git directory is not the correct repo
or you are unsure what this means choose another name with the '--name' option.
と言われてしまうので、メッセージに従い --force
オプションを付ける。
$ git submodule add --force https://github.com/Alamofire/Alamofire.git
Reactivating local git directory for submodule 'Alamofire'.
成功.
- まぁSwift対応した今となっては、pods使えっていう話ではある。