title: Long file paths using Git via TeamCity
body: <p>I am using TeamCity with Git and attempting to do a git checkout on the individual agent (This is part of a CI pipeline that will have to switch branches at some point, so I need the correct Git files in the working folder). </p>
  
  <p>Within our repository, we have long file names that are usually too long for Git to handle. These are NPM modules and cannot be removed from source control at this point in time. If you checkout the repository on a clean machine, you will get an error similar to the following. </p>
  
  <blockquote>
    <p>cannot create directory at '****/node_modules/grunt-autoprefixer/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test': Filename too long </p>
  </blockquote>
  
  <p>When cloning the repo locally on a developers machine, you have to call </p>
  
  <blockquote>
    <p>git config --system core.longpaths true</p>
  </blockquote>
  
  <p>And then everything is rosy. </p>
  
  <p>On a TeamCity build agent, I have done the same. When I call</p>
  
  <blockquote>
    <p>git config --list </p>
  </blockquote>
  
  <p>I can see that longpaths are enabled. When I do a checkout using git on that machine, I can also download the repository fine. </p>
  
  <p>However when I kick off a build from TeamCity, I get the same Filename too long error. I've restarted the machine (Turn it off and on again), and still no dice. </p>