0
0

はじめに

現在このリポジトリを新規クローンすると失敗することがあります。
その解決方法の共有です!

問題

以下のようなエラーが出た場合は、長いファイル名が含まれていることが原因である可能性が高いです。

fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

または

open("{くっそ長いpath}"): Filename too long unable to index file '{くっそ長いpath}'

解決

このような状況となった場合、以下のどちらかで対応できます!

  1. 対象のディレクトリにおいて、git bash で git config --local core.longpaths true を実行(対象のディレクトリのみ設定変更)
  2. git bash で git config --system core.longpaths true を実行(git for windows 全体の設定変更)

注意

git config --system core.longpaths true は管理者権限で git bash を開かないと以下のようなエラーが出るため注意です!!

$ git config --system core.longpaths true
error: could not lock config file C:/Program Files/Git/etc/gitconfig: Permission denied

参考

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