unable - git long file name support

git pull aborted with error filename too long (4)

Solution1 - set global config, by running this command:

git config --system core.longpaths true

Solution2 - or you can edit directly your specific git config file like below:

YourRepoFolder -> .git -> config:

    repositoryformatversion = 0
    filemode = false
    longpaths = true        <-- (add this line under core section)

Solution3 - when cloning a new repository: here.

I'm using Windows as my OS, and working on a project with a friend who's using a Mac. He checked in code to our Github.

I was trying to git pull everything he did and it aborted with "filename too long" errors of 3rd party code.

What can I do?

A few years late, but I'd like to add that if you need to do this in one fell swoop (like I did) you can set the config settings during the clone command. Try this:

git clone -c core.longpaths=true <your.url.here>

Open your.gitconfig file to add the longpaths property. So it will look like the following:

symlinks = false
autocrlf = true
longpaths = true

The msysgit FAQ on Git cannot create a filedirectory with a long path seems not up to date, as it still links to old msysgit ticket #110. However, according to later ticket #122 the problem has been fixed in msysgit 1.9, thus:

  1. Update to msysgit 1.9 (or later)
  2. Launch Git Bash
  3. Got to your Git repository which 'suffers' of long paths issue
  4. Enable long paths support with git config core.longpaths true

So far, it's worked for me very well.

Be aware of important notice in comment on the ticket #122

don't come back here and complain that it breaks Windows Explorer, cmd.exe, bash or whatever tools you're using.