3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Git】submoduleの追加と削除

Posted at

追加

リポジトリにサブモジュールを追加するには次のコマンドを実行します。

git submodule add サブモジュールのリポジトリURL サブモジュールのディレクトリ
git submodule add https://github.com/user/sample-submodule.git sample/sample-submdules

上記を実行した後に.gitmodulesファイルが作成されsample/sample-submodulesの中にhttps://github.com/user/sample-submodule.gitの内容がcloneされます。

削除

削除する際には次の手順を実行します。

$ git submodule                           
 4a3a41a70aeeb503f56cf7ba486235b6fao28af2 sample/sample-submodules (4a3a41a)
$ git submodule deinit sample/sample-submodules
$ git rm -f sample/sample-submodules
3
3
0

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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?