title: Git Add - fatal: adding files failed
body: <p>My git-cmd.exe window looks like this:</p>
  <pre><code>git add &quot;NextFolder/*&quot;
  error: unable to create temporary file: No such file or directory
  error: NextFolder/SomeFile.txt: failed to insert into database
  error: unable to index file 'NextFolder/SomeFile.txt'
  fatal: adding files failed
  </code></pre>
  <p>I'm adding a large number of files to a new git repo.  I have over 14,000 files spread out across about 80 folders in the root level.  Due to the volume I've decided to add and commit one folder at a time.  Seems each folder has some number of files that cause the &quot;git add&quot; operation to have a fatal error (see above).</p>
  <p>I'm using Git for Windows, portable version:</p>
  <pre><code>git --version
  git version 2.22.0.windows.1
  </code></pre>
  <p>I believe the error is somehow related to the content of the file.  I can rename the file, copy contents to a new file, rename that file, none of that will make it work.  I've found that if I add a CRLF at the very bottom of the file the problem is &quot;fixed&quot; for that file but the git add operation just hangs up on some other file in the folder with the same condition.</p>
  <p>I've been using Notepad++ to examine the files compared to other files that seem to get added without an issue.  Line endings look the same (CRLF), encoding looks the same (ANSI), etc.</p>
  <p>One of the comments in this thread seem to be describing my exact problem, but it's the last comment on an answer with no upvotes and the thread is 5yr old...</p>
  <p><a href="https://stackoverflow.com/questions/21627588/git-unable-to-create-temporary-file-no-such-file-or-directory-only-for-cert">git - unable to create temporary file: no such file or directory - only for certain files?</a></p>
  <p>I'm also fairly certain this is not a permissions issue.  That's the first thing that comes up in my research but I've copied the source code, in it's entirety, to my local machine to get everything added to git. So I'm thinking it shouldn't be a permissions issue since everything is local and most of the files are getting added.  Unless it's related to the volume of files or the fact I'm using Git portable.</p>
  <p>Been banging my head against this for hours, send help!</p>
  <p>EDIT: I should have pointed out that the git repo is seperate from the working tree. They are actually on different drives. Both are network drives, e.g. S:\path\to\tree and H:\git\test.git.  This is thought to be temporary, I am attempting to characterize the frequency of changes we have on the (working tree) network location.  Once I have better understanding of where we have the most churn, I'm thinking we will make smaller repos with the typical configuration, having the .git folder at the root of the working tree.</p>