Skip to content
English
  • There are no suggestions because the search field is empty.

What can I do when git runs into a long filename error?

By default on Windows, git has a filename limit of 260.  This can be increased in many cases

Filenames >260 characters are not too long for Windows. Rather, they are too long for git for Windows, as described below:

Simple answer: https://gitforwindows.org/git-cannot-create-a-file-or-directory-with-a-long-path.html

Detailed answer: https://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows

We recommend thoroughly reading the StackOverflow post for its description of the tradeoffs (and Registry keys, etc). However, the summarized version is to try the below: 

  1. Open the Windows Registry Editor and check the value of the key HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled

  2. If the value of the key is 0, set it to 1.  (This may require admin rights) 

  3. In Copia Desktop, Repository > Open Command Prompt

  4. git config core.longpaths true

  5. Retry the problematic file

    a. If the above causes problems, git config core.longpaths false to revert it. 

    b. If the above helps, git config --global core.longpaths true to set it for all repositories.