Papa Mufflon Papa Mufflon - 9 months ago 166
Git Question

Filename too long in git for windows

I'm using

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
git add .
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
from the
file. Then repeating the aforementioned git commands.

What am I missing here?

Answer Source

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:

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