LoginSignup
3
1

More than 3 years have passed since last update.

Windowsの予約語をフォルダ名に使用するとGitでCloneに失敗する

Posted at

事象

GitでCloneした際に、下記のエラーメッセージが表示されて、cloneに失敗する事象が発生。

# Git Error

fatal: cannot create directory at 'test/src/com1': 
Invalid argument
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

原因

GitでCloneした際に、Windowsの予約語に使用されている「com1」というフォルダが含まれていたため、cloneした際に、フォルダとして認識されなかったことが原因の模様。

対策

com1 → com_1にフォルダ名を変更

また、ファイルパスの文字数が260文字以上でも、cloneに失敗するケースもある模様。
https://kaizentech.hatenablog.com/entry/2018/04/27/104909

3
1
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
3
1