2
0

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

【ShopifyのTheme Kit導入】HomebrewでError: homebrew-core is a shallow clone で怒られた話

Last updated at Posted at 2021-02-05

ShopifyのTheme Kit導入に際してターミナルで以下のコマンドを入力したところHomebrewでError: homebrew-core is a shallow clone で怒られた時に解決した方法を残しておきます。

解決方法

解決策はエラー文で表示されたコマンドを実行

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

エラー内容

~ % brew tap shopify/shopify

Error: 
  homebrew-core is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
Deeplで翻訳したところ以下のような内容

更新を行うには、まず実行します。
git - C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
このコマンドはリポジトリのサイズが大きいため、実行に数分かかることがあります。
この制限は、GitHub の要請により行われました。
クローンは、木の配置や交通量が多いため、非常に高価な作業となります。
とのこと。

つまり

shallow clonesは非常に重たい処理をおこなってしまうためGitHubの要請を受けて高負荷のshallowの繰り返しを避けるために自動的に浅いクローンを使用しないように修正されています。

ふむ
ということで

解決策

解決策はエラー文で表示されたコマンドを実行

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

エンター後、数分おくと

結果

Error: 
  homebrew-core is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!
user@user-MBP ~ % git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow

remote: Enumerating objects: 532139, done.
remote: Counting objects: 100% (532101/532101), done.
remote: Compressing objects: 100% (192046/192046), done.
remote: Total 523512 (delta 334257), reused 517870 (delta 328618), pack-reused 0
Receiving objects: 100% (523512/523512), 199.08 MiB | 5.46 MiB/s, done.
Resolving deltas: 100% (334257/334257), completed with 3950 local objects.
From https://github.com/Homebrew/homebrew-core
   24213f07e5..8509715934  master     -> origin/master
user@user-MBP ~ % 
user@user-MBP ~ % brew tap shopify/shopify                                                        
user@user-MBP ~ % 

Shopify Theme Kitのコマンドが通りました。
以上です。

参考記事

update.sh: refuse to update shallow homebrew-core/cask clones. #9383

2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?