1. Qiita
  2. 投稿
  3. Git

gitでyarn.lockを常にバイナリとして扱う

  • 2
    いいね
  • 0
    コメント

git add -p で yarn.lock に突入するのを抑止したかった

やり方1: プロジェクト単位の設定

プロジェクトルートに以下のファイルを置く

.gitattributes
yarn.lock binary

やり方2: プロジェクトにコミットせず個人的に設定

.git/info/attributes
yarn.lock binary

やり方3: 個人のグローバルな設定

~/.gitconfig
[core]
attributesfile = ~/.gitattributes
~/.gitattributes
yarn.lock binary

Ruby の Gemfile.lock や Unity の Asset.yml に応用できる

参考