3

I have the following warnings from git that are causing Git Extensions to crash when I go to view my current modified files:

warning: unable to access 'mysolution.mobile/node_modules/gulp/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/.gitignore': Filename too long

I can see the warnings when I view git status in the command line

I thought about navigating Windows Explorer to the directory, but when i do there is no .gitignore file there.

The only files in the folder are

LICENSE
package.json
README.md
spdx-license-ids.json

What should I do about this?

I don't particularly care about committing the node stuff to my repository, so I could add this location to another .gitignore. However, I've read that it's preferable to commit the node stuff.

edit

Interestingly, when I try the following with the command line:

git add mysolution.mobile/node_modules/gulp/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/.gitignore

It returns the following error:

fatal: pathspec 'mysolution.mobile/node_modules/gulp/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/normalize-package-data/node_modules/validate-npm-package-license/node_modules/spdx-correct/node_modules/spdx-license-ids/.gitignore' did not match any files

did not match any files

Why does it claim to be an unstaged file if it can't find it?

Community
  • 1
  • 1
DaveDev
  • 41,155
  • 72
  • 223
  • 385
  • Have a look [here](http://stackoverflow.com/questions/22575662/filename-too-long-in-git-for-windows). Your example does not appear anywhere near the limit, but Git itself does not impose any length beyond what the OS does. You can get around this by switching to the Git Bash. – Tim Biegeleisen May 04 '16 at 08:03
  • Thanks @TimBiegeleisen, I just tried that with MINGW64, and it's returning the same error. However, that's with Git for Windows (https://git-for-windows.github.io/). I'll try with the one from https://git-scm.com/download/win when I get home! – DaveDev May 04 '16 at 08:09
  • 1
    Thanks @TimBiegeleisen, it turns out after a little further reading (i.e. reading the *second* answer in the link you suggested), the solution was to simply execute 'git config --system core.longpaths true'. – DaveDev May 04 '16 at 10:33

1 Answers1

0

This command should be run on your git directory.

git config --system core.longpaths true

Alternatively, you can change this option in your git config file.

RnDrx
  • 240
  • 3
  • 5