Papa Mufflon Papa Mufflon - 3 days ago 4
Git Question

Filename too long in git for windows

I'm using

Git-1.9.0-preview20140217
for Windows. As I know, this release should fix the issue with too long filenames. But not for me.

Surely I'm doing something wrong: I did
git config core.longpaths true
and
git add .
then
git commit
. Everything went well. But when I now do a
git status
, I get a list of files with
Filename too long
, e.g.

node_modules/grunt-contrib-imagemin/node_modules/pngquant-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js: Filename too long


It is quite simple to reproduce for me: just create a yeoman web app with the angular-generator ("yo angular") and remove
node_modules
from the
.gitignore
file. Then repeating the aforementioned git commands.

What am I missing here?

Answer

Git has a limit of 4096 characters for a filename, except on windows when git is compiled with msys. It uses an older version of the windows api and there's a limit of 260 characters for a filename.

So as far as I understand this, it's a limitation of msys and not of git. You can read the details here: https://github.com/msysgit/git/pull/110

You can circumvent this but using an other git-client on windows.

Comments