Pebble Coding

ソフトウェアエンジニアによるIT技術、数学の備忘録

macOS の git gc で warning: unable to unlink '.git/objects/ff/xxx': Operation not permitted

macOS で git gcしたときに、warning: unable to unlink '.git/objects/ff/xxx': Operation not permitted
というメッセージが表示される現象の対応方法です。

.git ディレクトリに移動して、以下のコマンドを打ちます。

chflags -R nouchg *

error: failed to run repack
と表示されるときも同じ対応でいけました。

git warnings about unable to unlink git objects. How do I resolve this? - Stack Overflow