10
7

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 5 years have passed since last update.

git のクローンを最小量にする(サブモジュールを含めたshallow clone)

Last updated at Posted at 2018-08-12

git のクローンを最小量にする

git clone (shallow、single-branch)

以下のコマンドで深さ1、特定ブランチのみでcloneする

$ git clone --depth 1 --single-branch -b <branch-name> <repo-uri>

git submodule (shallow)

以下のコマンドで、サブモジュールを再帰で初期化しつつ更新、shallowで深さ1でcloneする

$ git submodule update --init --recursive --recommend-shallow --depth 1 

なにか副作用(サブモジュールでもunshallowが必要か?とか)については運用して確認中


追記
いまのところ問題はないが、unshallow手順などをまとめる

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?