LoginSignup
0
0

More than 5 years have passed since last update.

iOSライブラリを導入する時にgit submoduleでエラーになる場合の対処

Last updated at Posted at 2015-04-30

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使えっていう話ではある。
0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0